View Full Version : 1.5beta1 - calender-addon date-bug.
Thank to TomR --> http://forum.pixelpost.org/showthread.php?p=22019
The calander-addon gives the wrong day by the date. You can see this only in the normal-mode.
Example:
4 jan 2006 gives Thursday, but must be Wednesday.
The bug is in Pixelpost 1.5, but also in earlier versions (test Pixelpost 1.4.3)
Joe[y]
01-04-2006, 07:58 PM
i remember this bug! i think... i was looking at it for ages - at least it was a bug in the calendar - i think it was the same bug.
i was totally stuck for what was wrong. perhaps somebody else will have more luck.
Maybe because monday was in the year 2005?
Total Super Wildguess (without logical thinking)
Joe[y]
01-04-2006, 08:17 PM
Maybe because monday was in the year 2005?
what do you mean?
Connie
01-04-2006, 08:18 PM
same problem happens with archive-calendar-addon
I use it in a more refined way, but the script is one of the oldest scripts which Punk wrote and I just noticed this problem as well
The problem is only when the first day of the month is a sunday.
Like on oktober 2006.
Has to be something to do with ~row 88:
$first_day_month = date("w", mktime(0,0,0,$curr_month,1,$curr_year));
This row gives an "0" on Sunday, but it has to be an "7".
www.php.net date()
w | Numeric representation of the day of the week | 0 (for Sunday) through 6 (for Saturday)
Solution addons/calender.php ~row 88:
$first_day_month = date("w", mktime(0,0,0,$curr_month,1,$curr_year));
if ($first_day_month=="0"){$first_day_month="7";}
Connie
01-04-2006, 08:53 PM
that corrects the date, thanks for the tip!
But the formatting of the table is still wrong, the "</tr><tr>" are not correct
in the archivecalendar-Addon
Unfortunately I am too tired in the moment to fix that, had too stressy day today..
we must fix that and we will fix that, I am sure ...
Connie
01-08-2006, 01:01 PM
I fixed the bug for the "normal" calendar in image_template.html like eon suggested
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.