Opened 13 years ago

Closed 11 years ago

#5121 closed bug (worksforme)

DatePicker dateFormat and defaultDate

Reported by: asmer Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

This works correct:

$("#startDateDiv").datepicker({altField: '#startDate',

altFormat: 'yy-mm-dd', dateFormat: 'yy-mm-dd'});

$('#startDateDiv').datepicker('option', 'defaultDate','<?php echo $_GETstartDate?; ?>' );

And this not works correctly:

$("#endDateDiv").datepicker({altField: '#endDate',

altFormat: 'yy-mm-dd', dateFormat: 'yy-mm-dd', defaultDate: '<?php echo $_GETendDate?; ?>'});

Change History (5)

comment:1 Changed 13 years ago by Jörn Zaefferer

Component: ui.coreui.datepicker

comment:2 Changed 13 years ago by Scott González

Milestone: TBD1.8

comment:3 Changed 13 years ago by kbwood

What is not working? Are the calendars not showing? Are the alternate fields not populated?

comment:4 Changed 12 years ago by ghallas

I have the same thing. What is not working, is that the dateFormat is not applied to the defaultDate when you set all the parameters in the $(selector).datepicker() call.

if you set the dateFormat, and then use

$('#startDateDiv').datepicker('option', 'defaultDate','someDate' ),

the dateFormat is applied to the defaultDate.

I hope I helped clear this out

comment:5 Changed 11 years ago by Jörn Zaefferer

Resolution: worksforme
Status: newclosed

Works: http://jsbin.com/okukox/edit#javascript,html

Probably got fixed since this issue was reported.

Note: See TracTickets for help on using tickets.