Skip to content Skip to sidebar Skip to footer

Jquery Ui Datepicker Take Value 1970 If Input Field Is Blank

i am using jquery ui date picker for take fromDate and toDate Following is the code of from date

Solution 1:

Change your PHP function is use empty instead of null

function showDate($date,$format='m-d-y, h:i a') {
   if(empty($date)) return ' ';
   return date($format,strtotime($date)); 
}

Solution 2:

try to set defaultDate: '' or remove it at all


Solution 3:

As you can find in jquery ui documentation (here), if you don't precise defaultDate option, default date is current date.


Post a Comment for "Jquery Ui Datepicker Take Value 1970 If Input Field Is Blank"