X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/16cbd33bec16854f1b6a4caf4ac24ededc8326f3..6c92bed7b97ace08101baa84c8aa171e5d127c28:/week.php diff --git a/week.php b/week.php index 44a05bdc..19453247 100644 --- a/week.php +++ b/week.php @@ -368,11 +368,12 @@ if ($request->isPost()) { $existingDuration = $dataArray[$rowNumber][$dayHeader]['duration']; // If posted value is not null, check and normalize it. if ($postedDuration) { - if (ttTimeHelper::isValidDuration($postedDuration)) { - $postedDuration = ttTimeHelper::normalizeDuration($postedDuration, false); // No leading zero. - } else { + if (false === ttTimeHelper::postedDurationToMinutes($postedDuration)) { $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration')); $result = false; break; // Break out. Stop any further processing. + } else { + $minutes = ttTimeHelper::postedDurationToMinutes($postedDuration); + $postedDuration = ttTimeHelper::minutesToDuration($minutes); } } // Do not process if value has not changed.