Implementation details for calendar.format
