Skip to content

Commit

Permalink
Update form fields for timed rule
Browse files Browse the repository at this point in the history
  • Loading branch information
DorsetDigital committed Feb 4, 2021
1 parent e8b62b4 commit e22afc6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Model/Rule/TimedRuled.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e22afc6

Please sign in to comment.