This error can happen if we're using a language like Chinese.
Code:
DateTime::__construct()
Within the page we have code like this
Code:
$datetimeStart = new JDate($row->dates.' '.$row->times);
$otimeStart = $datetimeStart->format('H:i');
$odateStart = $datetimeStart->format($dateFormat);
.........................
$result = array();
$result['dateStart'] = $odateStart;
.............
$start = new JDate($odateStart);
$start_day = $start->format('m-d-Y');
$end = new JDate($odateEnd);
$end_day = $end->format('m-d-Y');
..............
return $result;
when looking at the output we see that the values do have weird characters in it and can imagine why Joomla is trowing the error. The thing here is that JDate->format is localizing the output at default (month+day but no AM-PM). As we're passing the translated strings to the JDate function it will protest.
so to avoid the problem we've to make sure that untranslated strings will be passed into the second JDate function