Permalink
Browse files

Fix an issue with off by one for day of month and months sparkbars

  • Loading branch information...
1 parent ff2fdaf commit 1a531c3380581825e9d60811de176733e6ccbab1 @kormoc committed May 9, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 review.php
View
@@ -77,7 +77,7 @@ function timeStats($row) {
while ($i != $ts_max) {
$cnt++;
$i++;
- if ($i >= $max)
+ if ($i > $max)
$i -= $max;
}
@@ -87,7 +87,7 @@ function timeStats($row) {
while ($i != $ts_max) {
@$historyDataTime['monthday'][$i] += $per;
$i++;
- if ($i >= $max)
+ if ($i > $max)
$i -= $max;
}
}
@@ -104,7 +104,7 @@ function timeStats($row) {
while ($i != $ts_max) {
$cnt++;
$i++;
- if ($i >= 12)
+ if ($i > 12)
$i -= 12;
}
@@ -114,7 +114,7 @@ function timeStats($row) {
while ($i != $ts_max) {
@$historyDataTime['month'][$i] += $per;
$i++;
- if ($i >= 12)
+ if ($i > 12)
$i -= 12;
}
}
@@ -389,7 +389,7 @@ function timeStats($row) {
</span><br>
Day of the month <span class="inlinesparkbar" style="float: right;">
<?php
- for ($i = 0; $i < 31; $i++) {
+ for ($i = 1; $i <= 31; $i++) {
if (!isset($historyDataTime['monthday'][$i]))
echo "0,";
else
@@ -399,7 +399,7 @@ function timeStats($row) {
</span><br>
Months <span class="inlinesparkbar" style="float: right;">
<?php
- for ($i = 0; $i < 12; $i++) {
+ for ($i = 1; $i <= 12; $i++) {
if (!isset($historyDataTime['month'][$i]))
echo "0,";
else

0 comments on commit 1a531c3

Please sign in to comment.