Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Storz <philipp.storz@bareos.com>2022-11-13 12:52:05 +0300
committerGitHub <noreply@github.com>2022-11-13 12:52:05 +0300
commit5eb5d790b034b7fbd02efec410ba9503aa225721 (patch)
tree00ae5b5ed239c90012c9e6d61432847366f7de84
parent7be0e441b0e80696d2ef476c42c817ae4f92af6c (diff)
parentf61a7062b6013fdec551b3d36078163f3d3b3437 (diff)
Merge pull request #1283
webui: fix job timeline x-axis UTC timestamp issue
-rw-r--r--CHANGELOG.md2
-rw-r--r--webui/module/Job/src/Job/Controller/JobController.php15
2 files changed, 7 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d1dcb44cd..42c119eca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -53,6 +53,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- catalog: update fileset text in fileset record [PR #1300]
### Fixed
+- webui: fix job timeline x-axis UTC timestamp issue [PR #1283]
- webui: adapt links to new URLs after website relaunch. [PR #1275]
- dird: fix possible crash in tls context on configuration reload [PR #1249]
- dird: RunScript fixes [PR #1217]
@@ -352,6 +353,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
[PR #1277]: https://github.com/bareos/bareos/pull/1277
[PR #1278]: https://github.com/bareos/bareos/pull/1278
[PR #1279]: https://github.com/bareos/bareos/pull/1279
+[PR #1283]: https://github.com/bareos/bareos/pull/1283
[PR #1284]: https://github.com/bareos/bareos/pull/1284
[PR #1285]: https://github.com/bareos/bareos/pull/1285
[PR #1288]: https://github.com/bareos/bareos/pull/1288
diff --git a/webui/module/Job/src/Job/Controller/JobController.php b/webui/module/Job/src/Job/Controller/JobController.php
index 694d6d8f6..d17a88664 100644
--- a/webui/module/Job/src/Job/Controller/JobController.php
+++ b/webui/module/Job/src/Job/Controller/JobController.php
@@ -754,16 +754,11 @@ class JobController extends AbstractActionController
$jobs = array();
- // Ensure a proper date.timezone setting for the job timeline.
- // Surpress a possible error thrown by date_default_timezone_get()
- // in older PHP versions with @ in front of the function call.
- date_default_timezone_set(@date_default_timezone_get());
-
foreach($result as $job) {
- $starttime = new \DateTime($job['starttime']);
- $endtime = new \DateTime($job['endtime']);
- $schedtime = new \DateTime($job['schedtime']);
+ $starttime = new \DateTime($job['starttime'], new \DateTimeZone('UTC'));
+ $endtime = new \DateTime($job['endtime'], new \DateTimeZone('UTC'));
+ $schedtime = new \DateTime($job['schedtime'], new \DateTimeZone('UTC'));
$starttime = $starttime->format('U')*1000;
$endtime = $endtime->format('U')*1000;
@@ -783,7 +778,7 @@ class JobController extends AbstractActionController
case 'R':
case 'l':
$fillcolor = "#5bc0de";
- $endtime = new \DateTime(null);
+ $endtime = new \DateTime(null, new \DateTimeZone('UTC'));
$endtime = $endtime->format('U')*1000;
break;
// FAILED
@@ -806,7 +801,7 @@ class JobController extends AbstractActionController
case 'p':
case 'q':
$fillcolor = "#555555";
- $endtime = new \DateTime(null);
+ $endtime = new \DateTime(null, new \DateTimeZone('UTC'));
$endtime = $endtime->format('U')*1000;
break;
default: