webcalendar
webcalendar copied to clipboard
November has 2 x Sunday the 3rd
as seen here: http://webcalendar.sourceforge.net/demo/view_m.php?id=935&date=20191101
view_m.php repeats the Sunday as it loops thru using date + 86400 - which doesn't account for the hour change when DST ends
http://shrunk.com/cal-error.png screenshot
Slightly crappy fix by testing if we've gained or lost an hour
for ( $date = $startdate; $date <= $enddate; $date += 86400 ) {
//date should always be 00 hours entering DST turns this into 01 (end of March)
//leaving DST turns into 23 (end of October)
$DSTtest = date("H",$date);
if ($DSTtest == "23") {
$date = $date + 3600;
}
if ($DSTtest == "01" ) {
$date = $date - 3600;
}
$dateYmd = date ( 'Ymd', $date );
https://github.com/craigk5n/webcalendar/blob/master/view_m.php#L133
Crappy fix, but works, to get the double day away, thanks