projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed monthly quotas for negative hours.
[timetracker.git]
/
WEB-INF
/
lib
/
ttTimeHelper.class.php
diff --git
a/WEB-INF/lib/ttTimeHelper.class.php
b/WEB-INF/lib/ttTimeHelper.class.php
index
8142a26
..
44d9678
100644
(file)
--- a/
WEB-INF/lib/ttTimeHelper.class.php
+++ b/
WEB-INF/lib/ttTimeHelper.class.php
@@
-188,8
+188,11
@@
class ttTimeHelper {
// toMinutes - converts a time string in format 00:00 to a number of minutes.
static function toMinutes($value) {
// toMinutes - converts a time string in format 00:00 to a number of minutes.
static function toMinutes($value) {
+ $signMultiplier = ttStartsWith($value, '-') ? -1 : 1;
+ if ($signMultiplier == -1) $duration = ltrim($duration, '-');
+
$time_a = explode(':', $value);
$time_a = explode(':', $value);
- return
(int)@$time_a[1] + ((int)@$time_a[0]) * 60
;
+ return
$signMultiplier * ((int)@$time_a[1] + ((int)@$time_a[0]) * 60)
;
}
// toAbsDuration - converts a number of minutes to format 0:00
}
// toAbsDuration - converts a number of minutes to format 0:00