Accept unix time for --start CLI option

This commit is contained in:
Alexander
2020-01-22 10:27:13 +13:00
parent 2366b3ea18
commit 1d1fb94142
3 changed files with 5 additions and 3 deletions

View File

@@ -170,7 +170,9 @@ class create extends clibase {
$this->become_admin_user();
// Create the outage.
$start = $this->time + $options['start'];
// If time is above 1500000000 then it must be a unix time timestamp, otherwise they are trying to create
// an outage 47 years in advance.
$start = $options['start'] > 1500000000 ? $options['start'] : $this->time + $options['start'];
$outage = new outage([
'autostart' => $options['autostart'],
'warntime' => $start - $options['warn'],