The _calendar_make_node() function does not properly account for days that do not exist. For instance, on January 29th (when I'm submitting this) if I try to view the month block for February, it tries to create a timestamp for February 29th, which doesn't exist this year, and so returns March 1st, causing the block to display the calendar for March.

I'm at work so once again can't roll a real patch, but here's what I did to fix it. Right before the line:

$timestamp = gmmktime($hour, $minute, 0, $month, $day, $year);

Add this:

while (!checkdate($month, $day, $year)) $day--; // Account for days that don't exist

Cheers. (Marking as patch even though there's no proper patch attached so that it gets noticed. Sorry.)

Comments

KarenS’s picture

Status: Needs review » Fixed

Thanks! Yes this fixed the problem and also the problem of the missing February calendar when no nodes were in month.

Anonymous’s picture

Status: Fixed » Closed (fixed)