fix datetime modify to now (#3511)
This commit is contained in:
@@ -55,7 +55,11 @@ final class DurationFixedBeginMode implements TrackingModeInterface
|
||||
}
|
||||
|
||||
$newBegin = clone $timesheet->getBegin();
|
||||
$newBegin->modify($this->configuration->getTimesheetDefaultBeginTime());
|
||||
|
||||
// this prevents the problem that "now" is being ignored in modify()
|
||||
$beginTime = (new DateTime($this->configuration->getTimesheetDefaultBeginTime(), $newBegin->getTimezone()))->format('H:i:s');
|
||||
$newBegin->modify($beginTime);
|
||||
|
||||
$timesheet->setBegin($newBegin);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,12 @@ final class DurationOnlyMode extends AbstractTrackingMode
|
||||
}
|
||||
|
||||
$newBegin = clone $timesheet->getBegin();
|
||||
$newBegin->modify($this->configuration->getTimesheetDefaultBeginTime());
|
||||
|
||||
// this prevents the problem that "now" is being ignored in modify()
|
||||
$beginTime = $this->configuration->getTimesheetDefaultBeginTime();
|
||||
$beginTime = (new DateTime($this->configuration->getTimesheetDefaultBeginTime(), $newBegin->getTimezone()))->format('H:i:s');
|
||||
$newBegin->modify($beginTime);
|
||||
|
||||
$timesheet->setBegin($newBegin);
|
||||
|
||||
parent::create($timesheet, $request);
|
||||
|
||||
Reference in New Issue
Block a user