Near line 252 where you create "easy readable date for modules which use hook_calendar_block()", you pad the month manually if it is single digit but you forget to do the same with the day, rendering those provided date values invalid.

And a suggestion: instead of getting the length and using an inline IF, just use the sprintf() function of PHP to do it for you elegantly and efficiently:

$date->date = sprintf('%04d-%02d-%02d', $date->year, $date->month, $date->day);

or whichever order of the date elements you want.

Bye

Comments

andribas’s picture

thank you.