calendar.php: Fixed problems with dates (extended so that all dates are handled correctly)