Default value datepicker not showing
I have the following datepicker function where I would like the DefaultDate to be displayed when opening the page. However
selectDefaultDate: true does not work. The date is used as a filter so when another date is selected the selected dat should show and persist in the view.
How can I get it to display the default date on opening of the page?
A second question I have is how to set the DefaultDate to the dirst day of the current year: 01/01/YY ?
- jQuery(function() {
- jQuery( "#hour_datefrom" ).datepicker({
- dateFormat: 'dd/mm/yy',
- showOn: "button",
- buttonImage: "<?=JAVASCRIPT_PATH?>/javascript/jquery/jquery-ui/images/calendar.gif",
- buttonImageOnly: true,
- changeMonth: true,
- defaultDate: '01/02/2013',
- selectDefaultDate: true,
- onSelect: function(selected) {
- jQuery("#hour_dateto").datepicker("option","minDate", selected),
- jQuery( "#hour_datefrom" ).datepicker('option', 'setDate', selected);},
- onClose: function(){ jQuery( "#hour_datefrom" ).focus();}
- }).click(function() { jQuery(this).datepicker('show'); });
- });
html:
- <input type="text" name="hour_datefrom" id="hour_datefrom" class="validate[required] "
- value="<?=$this->setExtraPara['hour_datefrom']?>" />