[geeklog-cvs] geeklog: Merging - forgot to pull Sean's leap year fix first ...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Thu Jun 11 05:25:28 EDT 2009
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9ce9e9715cad
changeset: 7096:9ce9e9715cad
user: Dirk Haun <dirk at haun-online.de>
date: Thu Jun 11 11:25:01 2009 +0200
description:
Merging - forgot to pull Sean's leap year fix first ...
diffstat:
system/classes/calendar.class.php | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diffs (48 lines):
diff -r d2feddf4150d -r 9ce9e9715cad system/classes/calendar.class.php
--- a/system/classes/calendar.class.php Thu Jun 11 11:19:23 2009 +0200
+++ b/system/classes/calendar.class.php Thu Jun 11 11:25:01 2009 +0200
@@ -177,7 +177,7 @@
*/
function getDayOfWeek($day = 1, $month = 1, $year = '')
{
- if (empty($year)) {
+ if (empty($year)) {
$year = $this->_default_year;
}
@@ -225,7 +225,14 @@
$year = $this->_default_year;
}
- if (round(($year - 2000)/4) == (($year - 2000)/4)){
+ if (($year % 4) == 0) {
+ if (($year % 100) == 0) {
+ if (($year % 400) == 0) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
return 1;
} else {
return 0;
@@ -351,8 +358,8 @@
*/
function getMonthName($month = 1)
{
- $month = $month - 1;
- if (empty($this->_lang_months)) $this->setLanguage();
+ $month = $month - 1;
+ if (empty($this->_lang_months)) $this->setLanguage();
switch ($month) {
case 0:
@@ -485,7 +492,7 @@
} else {
$cur_day = new CalendarDay();
$cur_day->year = $year;
- $cur_day->daynumber = $nextday;
+ $cur_day->daynumber = $nextday;
$week[$aw][$wd] = $cur_day;
// Bail if we just printed last day
More information about the geeklog-cvs
mailing list