Skip to content
Browse files

Bug fix: 'off by one'month bug in mupltiple locations.

When the system/user time zone was set to GMT-13 months would lag behind by
one month.


Author: Matt Clarkson <mattc@catalyst.net.nz>
  • Loading branch information...
1 parent 20414f2 commit 8632e95b139fdb54e36997af24da118710465b64 martinlanghoff committed Apr 13, 2007
Showing with 6 additions and 6 deletions.
  1. +1 −1 calendar/lib.php
  2. +1 −1 enrol/authorize/enrol_form.php
  3. +2 −2 lib/form/dateselector.php
  4. +2 −2 lib/form/datetimeselector.php
View
2 calendar/lib.php
@@ -1338,7 +1338,7 @@ function calendar_print_month_selector($name, $selected) {
$months = array();
for ($i=1; $i<=12; $i++) {
- $months[$i] = userdate(gmmktime(12, 0, 0, $i, 1, 2000), '%B');
+ $months[$i] = userdate(gmmktime(12, 0, 0, $i, 15, 2000), '%B');
}
choose_from_menu($months, $name, $selected, '');
View
2 enrol/authorize/enrol_form.php
@@ -59,7 +59,7 @@ function definition()
$monthsmenu = array('' => get_string('choose'));
for ($i = 1; $i <= 12; $i++) {
- $monthsmenu[$i] = userdate(gmmktime(12, 0, 0, $i, 1, 2000), "%B");
+ $monthsmenu[$i] = userdate(gmmktime(12, 0, 0, $i, 15, 2000), "%B");
}
$yearsmenu = array('' => get_string('choose'));
$nowdate = getdate();
View
4 lib/form/dateselector.php
@@ -71,7 +71,7 @@ function _createElements()
$days[$i] = $i;
}
for ($i=1; $i<=12; $i++) {
- $months[$i] = userdate(gmmktime(12,0,0,$i,1,2000), "%B");
+ $months[$i] = userdate(gmmktime(12,0,0,$i,15,2000), "%B");
}
for ($i=$this->_options['startyear']; $i<=$this->_options['stopyear']; $i++) {
$years[$i] = $i;
@@ -214,4 +214,4 @@ function exportValue(&$submitValues, $assoc = false)
// }}}
}
-?>
+?>
View
4 lib/form/datetimeselector.php
@@ -70,7 +70,7 @@ function _createElements()
$days[$i] = $i;
}
for ($i=1; $i<=12; $i++) {
- $months[$i] = userdate(gmmktime(12,0,0,$i,1,2000), "%B");
+ $months[$i] = userdate(gmmktime(12,0,0,$i,15,2000), "%B");
}
for ($i=$this->_options['startyear']; $i<=$this->_options['stopyear']; $i++) {
$years[$i] = $i;
@@ -228,4 +228,4 @@ function exportValue(&$submitValues, $assoc = false)
// }}}
}
-?>
+?>

0 comments on commit 8632e95

Please sign in to comment.
Something went wrong with that request. Please try again.