瀏覽代碼

fix, when you compare 2 timestamps, make sure you correct both timestamps
with the timezone

stekkel 21 年之前
父節點
當前提交
b5e7dceef6
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      functions/date.php

+ 4 - 1
functions/date.php

@@ -342,11 +342,14 @@ function getDateString( $stamp ) {
     $now = time();
     $now = time();
     
     
     $dateZ = date('Z', $now );
     $dateZ = date('Z', $now );
+
+    // FIXME: isn't this obsolete and introduced as a terrible workaround
+    // for bugs at other places which are fixed a long time ago? 
     if ($invert_time) {
     if ($invert_time) {
         $dateZ = - $dateZ;
         $dateZ = - $dateZ;
     }
     }
     $midnight = $now - ($now % 86400) - $dateZ;
     $midnight = $now - ($now % 86400) - $dateZ;
-    $nextmid = $midnight + 86400;
+    $nextmid = $midnight + 86400 - $dateZ;
     
     
     if (($show_full_date == 1) || ($nextmid < $stamp)) {
     if (($show_full_date == 1) || ($nextmid < $stamp)) {
         $date_format = _("M j, Y");
         $date_format = _("M j, Y");