This is a simple widget calendar based on JS Calendar
Requirements ¶
Test on Yii 1.1.10
Usage ¶
A calendar in Germany language:
<?php echo $form->labelEx($model,'effective_from'); ?>
<?php echo $form->textField($model,'date_of_birth',array('id'=>'effective_from')); ?>
<?php
$this->widget('ext.gcalendar.GCalendar',array(
'model' =>$model,
'theme' => 'gray',
'inputField'=>'effective_from',
'daFormat'=>'yyyy-mm-dd hh:ii',
'languageCode' => 'ge',
)
);
?>
<?php echo $form->error($model,'effective_from'); ?>
- model: model of form
- inputField: id/name of textfield
- theme: optional default='blue' , other support theme gray, light-cyan,zune
- daFormat: optional the string format tell what it it :) (e.g yyyy=2012, mm=08, dd=20, hh:04, ii=17) now support three string delimit "-","/", & "./"
- languageCode: optional (default='en') calendar language configuration
Demo Picture ¶
Resources ¶
Change Log ¶
20, August 2012
- Version 1
Support for more language: en = english, fi=finish, sv=swedish, pt-br=brazilain portuguese, ge = german, no = norwegian,nl = dutch, es = spanish, pt-br = portuguese, fr = french, da = danish, hu = hungarian
14, August 2012 - Initial Release
I have removed my initial version since there are some bug & CSS issue plz refer to version 1 instead
Calendar is not showing
if the text field is already filled suppose with "current date" then the calendar will not show the required results i.e in case of inserting value in textField the calendar will not show the required results.
<?php $form->textField($model,'enddate',array('id'=>'effective_from','value'=>date('l, d F, Y', $dateOneMonthAdded))); ?>
Similarly in case of the following dateformat the gcalendar cannot pick the date
'daFormat'=>'l, d F, Y hh:ii',
Not a calendar...
In my view this is a datePicker not a calendar.
Re: Calendar is not showing
Yes, Amjad Khan. This is a known bug from JSCalendar itself..
I have changed to use Calendar/Date Picker from http://www.dynarch.com/projects/calendar for my project.
Unfortunately just checked the site is temporary down.
But i still have source code compile into an extension i can share if you are interested via email...
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.