Create your data feed

Service dates and times

Calendar.txt defines different services, showing on which days of the week the services are available and when the services start and end.

calendar.txt file structure

The following example shows a simple calendar.txt file:

service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date

WE,0,0,0,0,0,1,1,20060701,20060731

WD,1,1,1,1,1,0,0,20060701,20060731

Service exceptions

Define exceptions for these services in the calendar_dates.txt field. Typically you remove exceptional dates like holidays from one service and add them to another. For example, if December 25 falls on a weekday, you might remove the date from the weekday service and add it to the weekend service instead.

The time period covered by calendar_dates.txt should match the time period covered by calendar.txt. Otherwise service exceptions can be missed and users will receive inaccurate information. The service period covered in the feed must be at least 30 days and should be consistent for all services.

Was this helpful?
How can we improve it?