--- a/server/src/app/Libraries/Utils.php Fri Nov 27 17:59:36 2015 +0100
+++ b/server/src/app/Libraries/Utils.php Tue Dec 01 13:33:08 2015 +0100
@@ -15,7 +15,7 @@
*/
public static function dateIntervalToMillis(\DateInterval $di) {
if(is_null($di)) {
- return 0;
+ return null;
}
$seconds = ($di->s)
+ ($di->i * 60)
@@ -35,9 +35,13 @@
* @return the number of milliseconds or 0 if $str is null
*/
public static function iso8601IntervalToMillis($str) {
- if(is_null($str) || $str === '') {
+ if(is_null($str)) {
+ return null;
+ }
+ elseif( $str === '') {
return 0;
}
+
$di = new \DateInterval($str);
return self::dateIntervalToMillis($di);
}