]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/Utils.php
format_date: include timezone in IntlDateFormatter object
[github/shaarli/Shaarli.git] / application / Utils.php
index 4c2d670133f84b002a8b15c0c8c47815b4a23860..c5cd884b7291ba328336837430d4579f12ec2b0e 100644 (file)
@@ -323,6 +323,7 @@ function format_date($date, $time = true, $intl = true)
         IntlDateFormatter::LONG,
         $time ? IntlDateFormatter::LONG : IntlDateFormatter::NONE
     );
+    $formatter->setTimeZone($date->getTimezone());
 
     return $formatter->format($date);
 }
@@ -382,8 +383,10 @@ function return_bytes($val)
     switch ($last) {
         case 'g':
             $val *= 1024;
+        // do no break in order 1024^2 for each unit
         case 'm':
             $val *= 1024;
+        // do no break in order 1024^2 for each unit
         case 'k':
             $val *= 1024;
     }