converted calendar to php