0
背景jQuery日期/時間選擇器設置默認時間沒有設置爲我指定的?
我想設置這個jQuery插件的默認日期和默認時間:http://trentrichardson.com/2010/04/19/timepicker-addon-for-jquery-ui-datepicker/
問題
時代改變,但到我指定的值。例如,對於日期,我傳遞的值爲2013-12-16
,並將其更改爲12-16-2013
。 Timepicker是相似的,我通過在'03:00:00'
和它它改變到8:00AM
守則
的值作爲從PHP字符串檢索。
$('#appointmentTime').timepicker({
controlType: 'select',
timeFormat: 'h:mm TT',
ampm: true,
step: '15'
});
$('#appointmentTime').timepicker('setTime', '<?echo $ascStudent->get("nextAppointmentTime")?>');
$('#appointmentDate').datepicker({dateFormat: 'mm-dd-yy'});
$('#appointmentDate').datepicker('defaultDate', '<?echo $ascStudent->get("nextAppointmentDate")?>');