I am facing a facing a problem with JHTMl calender method. Here is my code what I am trying to do:
edit.php
$this->event->from_date="2013-11-20 5:10:00";
$from_date = explode(" ", $this->event->from_date);
$from_time12 = date("m-d-Y", strtotime($from_date[0]));
echo JHTML::_('calendar', $from_time12, 'from_date', 'from_date', '%m-%d-%Y', array('class' => 'required', 'size' => '15', 'onchange' => 'getfromdate(this.value)'));
It's working fine for new item but when i edit the existing item it's shows error :
DateTime::__construct(): Failed to parse time string (10-22-2013) at position 0 (1): Unexpected character
I don't understand what's the problem. If anyone has suggestion please help.Thanks.