diff --git a/src/Model/Rule/TimedRuled.php b/src/Model/Rule/TimedRuled.php index 43eca02..3682814 100644 --- a/src/Model/Rule/TimedRuled.php +++ b/src/Model/Rule/TimedRuled.php @@ -42,8 +42,18 @@ public function getFormFields() $configJSON = $this->getConfig(); $config = json_decode($configJSON, true); - $fields[] = DatetimeField::create('FromTime', 'Start date/time'); - $fields[] = DatetimeField::create('ToTime', 'End date/time'); + $fromField = DatetimeField::create('FromTime', 'Start date/time'); + $toField = DatetimeField::create('ToTime', 'End date/time'); + + if (isset($config['from'])) { + $fromField->setValue($config['from']); + } + if (isset($config['to'])) { + $toField->setValue($config['to']); + } + + $fields[] = $fromField; + $fields[] = $toField; return $fields; }