Fix calendar for older php versions