From dc47c074d777c3d5568bf1e8c7e2145f3decd5a3 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 5 Sep 2017 13:15:57 +0200 Subject: [PATCH] Handle absolute dates and times before 1970-01-01T00:00:01+0000 refs #33 --- application/forms/TimeRangePickerForm.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/forms/TimeRangePickerForm.php b/application/forms/TimeRangePickerForm.php index 005a9fb..74a37d5 100644 --- a/application/forms/TimeRangePickerForm.php +++ b/application/forms/TimeRangePickerForm.php @@ -162,6 +162,10 @@ class TimeRangePickerForm extends Form $this->getUrl()->remove("graph_$part"); } else { + if ($dateTime->getTimestamp() < 1) { + $dateTime = DateTime::createFromFormat('U', '1')->setTimezone($this->getTimeZone()); + } + if ($addInterval !== null) { $dateTime->add(new DateInterval($addInterval)); }