Skip to content

Commit

Permalink
Enforce ISO-formatted date when setting timed rule field values
Browse files Browse the repository at this point in the history
  • Loading branch information
DorsetDigital committed Feb 24, 2021
1 parent 272e985 commit 567447a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Model/Rule/TimedRuled.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 567447a

Please sign in to comment.