From 40aaf767965931f2ed8a19dcaa27ab4d8dbbd23f Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 27 Jan 2021 10:23:22 -0700 Subject: [PATCH] Timesheet: more timezone date fixes This time start time was improperly processed, fixed end_time too --- timesheet/inc/class.timesheet_ui.inc.php | 8 ++++---- timesheet/templates/default/edit.xet | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index f63f26292f..8388c242b9 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -134,15 +134,15 @@ class timesheet_ui extends timesheet_bo { //$content['ts_start'] += $content['start_time']; $start = new Api\DateTime($content['ts_start']); - $start_time = explode(':',$content['start_time']); - $start->setTime($start_time[0],$start_time[1]); + $start_time = new Api\DateTime($content['start_time']); + $start->setTime($start_time->format('H'),$start_time->format('i')); $content['ts_start'] = $start->format('ts'); } if (isset($content['end_time'])) // end-time specified { $end = new Api\DateTime($content['ts_start']); - $end_time = explode(':',$content['end_time']); - $end->setTime($end_time[0],$end_time[1]); + $end_time = new Api\DateTime($content['end_time']); + $end->setTime($end_time->format('H'),$end_time->format('i')); } if ($end && $start) // start- & end-time --> calculate the duration { diff --git a/timesheet/templates/default/edit.xet b/timesheet/templates/default/edit.xet index c8ebe6579b..81c3a77808 100644 --- a/timesheet/templates/default/edit.xet +++ b/timesheet/templates/default/edit.xet @@ -112,7 +112,7 @@ - +