diff --git a/include/fields/DateTimeField.php b/include/fields/DateTimeField.php index b907bdbfe9d696eff40a0b2405a1e0dd3f3e979f..aa94fa6f7bf97f1004cc13d71d6457b1d98e3d95 100644 --- a/include/fields/DateTimeField.php +++ b/include/fields/DateTimeField.php @@ -137,12 +137,12 @@ class DateTimeField { list($d, $m, $y) = explode('-', $date); break; case 'mm-dd-yyyy': - if (strpos($date, '-') !== false && count(explode('-', $date)) === 3) { + if (substr_count($date, '-') == 2) { list($m, $d, $y) = explode('-', $date); } break; case 'yyyy-mm-dd': - if (strpos($date, '-') !== false && count(explode('-', $date)) === 3) { + if (substr_count($date, '-') == 2) { list($y, $m, $d) = explode('-', $date); } break;