ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/BBClone/trunk/show_time.php
(Generate patch)

Comparing trunk/show_time.php (file contents):
Revision 239 by matthys, Fri Jan 10 10:37:08 2014 UTC vs.
Revision 240 by matthys, Fri Jan 24 09:17:10 2014 UTC

# Line 55 | Line 55 | function bbc_graph_spacer($last, $nr, $v
55   // Plot a positive sequence of integers $y in function of a sequence $x
56   // (whatever it is) in a box of size [$width * $height] in pixels
57   function bbc_plot($x, $y, $width, $height) {
58 <  global $BBC_IMAGES_PATH, $translation;
58 >  global $BBC_IMAGES_PATH, $BBC_TIME_OFFSET, $translation;
59  
60    // Various sizes
61    $nb_x = count($x);
# Line 97 | Line 97 | function bbc_plot($x, $y, $width, $heigh
97  
98        $bbc_column_color = "column";  // default column color
99        if ($nb > 27 || $nb == 7) {  // make sure it's a month and not a week, hour, etc.
100 <        $bbc_weekend = mktime(0, 0, 0, date("m"), date("d") - ($nb - $k - 1), date("Y"));
100 >        $bbc_weekend = mktime(date("G"), date("i"), 0, date("m"), date("d") - ($nb - $k - 1), date("Y"));
101 >        // Correct for time offset
102 >        $bbc_weekend = $bbc_weekend + ($BBC_TIME_OFFSET * 60);
103          if (date("w", $bbc_weekend) == 0 || date("w", $bbc_weekend) == 6) {  // 0 is Sunday and 6 is Saturday
104            $bbc_column_color = "weekend-column";  // column color for weekends
105          }
106        } else if ($nb == 24) {
107 <        $bbc_weekend = mktime(date("G") - ($nb - $k - 1), 0, 0, date("m"), date("d"), date("Y"));
107 >        $bbc_weekend = mktime(date("G") - ($nb - $k - 1), date("i"), 0, date("m"), date("d"), date("Y"));
108 >        // Correct for time offset
109 >        $bbc_weekend = $bbc_weekend + ($BBC_TIME_OFFSET * 60);
110        } else {
111 <        $bbc_weekend = mktime(0, 0, 0, date("m") - ($nb - $k - 1), date("d"), date("Y"));
111 >        $bbc_weekend = mktime(date("G"), date("i"), 0, date("m") - ($nb - $k - 1), date("d"), date("Y"));
112 >        // Correct for time offset
113 >        $bbc_weekend = $bbc_weekend + ($BBC_TIME_OFFSET * 60);
114        }
115  
116        $str .= "<td class=\"sky\" height=\"".($height - $bar_height)."\" "

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines