[EXTENSION] Calendar


I have problem with IE7, calendar is shown almost 200px top than where i want to be displayed. It is good for mozilla and IE8

any idea how can i solve this issue



thanks all i fixed the bug

Can you tell us what you did to fix it?

Can someone tell me what I’m doing wrong?


YII 1.1.7

Calendar 1.2.2

I created a very basic db w/ a tbl_general_info that has a date field called test_date. I used gii to create the Model and CRUD operations. Then I added the calendar extension to my _view.php file. Here’s the file:

<?php Yii::import('application.extensions.calendar.SCalendar'); ?>

<div class="view">

	<b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>

	<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>

	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('id_code')); ?>:</b>

	<?php echo CHtml::encode($data->id_code); ?>

	<br />

	<b><?php echo CHtml::activeLabelEx($model, 'test_date'); ?>:</b>

	<?php echo CHtml::activeTextField($model, 'test_date', array("id"=>"test_date")); ?>

	<?php $this->widget('application.extensions.calendar.SCalendar', array('inputField'=>'test_date','ifFormat'=>%Y-%m-%d));

	<br />

	<b><?php echo CHtml::encode($data->getAttributeLabel('followup_date')); ?>:</b>

	<?php echo CHtml::encode($data->followup_date); ?>

	<br />


NB: /extensions/calendar exists.







instead of




Thanks Spyros. Can’t believe I missed that. I was also working w/ the wrong file. I should have been modifying the _form.php file that’s used for modifying values. The _view.php seems to be for display purposes only i.e. listing the content of the model.

Awesome plugin. For completeness, all I had to do was this:


<div class="row">	

  <?php echo $form->labelEx($model,'test_date'); ?>

  <?php echo $form->textField($model,'test_date', array("id"=>"test_date")); ?>

  <?php Yii::import('ext.calendar.SCalendar'); ?>

  <?php $this->widget('ext.calendar.SCalendar',array('inputField'=>'test_date', 'ifFormat'=>'%Y-%m-%d',)); ?>

  <?php echo $form->error($model,'test_date'); ?>


Hi there!

Thanks for this great plugin. I have one problem, to which i have tried countless times and failed. I want the years in the drop down list not to skip by a year, (e.g 2001,2002,2003…instead of 2001,2003,2005…). I have read about $_step but couldn’t get it done.



I’m using the following code into my _form:

   &lt;div class=&quot;row&quot;&gt;


          &lt;?php echo CHtml::activeLabelEx(&#036;model,'datosofertafechainicio'); ?&gt; 

          &lt;?php echo CHtml::activeTextField(&#036;model,'datosofertafechainicio',array('id'=&gt;'datosofertafechainicio')); ?&gt; 

          &lt;?php echo CHtml::image(Yii::app()-&gt;baseUrl.&quot;/images/calendar.jpg&quot;,&quot;calendar&quot;, array(&quot;id&quot;=&gt;&quot;ds_button&quot;,&quot;class&quot;=&gt;&quot;pointer&quot;)); ?&gt; 

          &lt;?php &#036;this-&gt;widget('application.extensions.calendar.SCalendar', array( 'inputField'=&gt;'datosofertafechainicio', 'button'=&gt;'ds_button', 'skin'=&gt;&#036;skin, 'stylesheet'=&gt;&#036;style, 'ifFormat'=&gt;'%Y-%m-%d', 'range'=&gt;'[2000,2050]', 'cache'=&gt;true,'language'=&gt;'es', )); ?&gt;

          &lt;?php echo &#036;form-&gt;error(&#036;model,'datosofertafechainicio'); ?&gt;


I have a issue with IE8.

Thanks in advanced.


Does anyone know who to set the default date? I tried the following which is a valid JavaScript Date() object format but it doesn’t work.

<?php echo  $form->textField($model,'Birthdate',array('id'=>'birth_date','class'=>'appfld')); ?>

	&nbsp;(calendar appears when textbox is clicked)

<?php $this->widget('application.extensions.calendar.SCalendar',





	)); ?>