From 567447affa81003a77050bc735e05caeb94d4f07 Mon Sep 17 00:00:00 2001 From: Tim Burt Date: Wed, 24 Feb 2021 16:29:07 +0000 Subject: [PATCH] Enforce ISO-formatted date when setting timed rule field values --- src/Model/Rule/TimedRuled.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Rule/TimedRuled.php b/src/Model/Rule/TimedRuled.php index 9191369..1c4f4a8 100644 --- a/src/Model/Rule/TimedRuled.php +++ b/src/Model/Rule/TimedRuled.php @@ -46,11 +46,11 @@ public function getFormFields() $toField = DatetimeField::create('ToTime', 'End date/time')->setHTML5(true); if ((isset($config['from'])) && (!is_array($config['from']))) { - $fromValue = (string)$config['from'] . ":00"; + $fromValue = date('c', strtotime($config['from'])); $fromField->setValue($fromValue); } if ((isset($config['to'])) && (!is_array($config['to']))) { - $toValue = (string)$config['to'] . ":00"; + $toValue = date('c', strtotime($config['to'])); $toField->setValue($toValue); }