From 8acd94b918b37d7fbd1af0c0663a0c4332e4cf0d Mon Sep 17 00:00:00 2001 From: ADmad Date: Mon, 7 Nov 2016 01:31:18 +0530 Subject: [PATCH] Simply check for datetime / chronos object. --- src/View/Widget/DateTimeWidget.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/View/Widget/DateTimeWidget.php b/src/View/Widget/DateTimeWidget.php index 1b0aaa24..20e61e40 100644 --- a/src/View/Widget/DateTimeWidget.php +++ b/src/View/Widget/DateTimeWidget.php @@ -1,12 +1,11 @@ _convertPHPToMomentFormat($data['data-format']); } - if (!($val instanceof DateTime || $val instanceof ChronosInterface) && !empty($val)) { + if (!($val instanceof DateTimeInterface) && !empty($val)) { $val = $type === 'date' ? Time::parseDate($val) : Time::parseDateTime($val); }