Skip to main content
Last updated: 14 Jul 2021

frontend: Calendars

Calendar JSON data files are stored in lib/data/<scope>.json, with a divisions hash for separate data per region (united-kingdom, england-and-wales, scotland or northern-ireland).

Each scope's data file contains a list of divisions, containing a list of years, each with a list of events:

{
  "title": "UK bank holidays",
  "description": "UK bank holidays calendar - see UK bank holidays and public holidays for 2012 and 2013",
  "divisions": {
    "england-and-wales": {
      "title": "England and Wales",
      "2011": [{
        "title": "New Year's Day",
        "date": "02/01/2011",
        "notes": "Substitute day"
      }]
    }
  }
}

The division title attribute is optional. If this is not present the slug will be humanized and used instead.

Publishing Calendars

Send the calendars to the publishing-api:

`bundle exec rake publishing_api:publish_calendars`

If you're using govuk-docker, you may need to govuk-docker-up on publishing-api in a separate shell. You may also need to run the rake task a couple of times if you encounter timeouts.

Search indexing is performed automatically on data sent to publishing api.

Bank Holidays

A rake task has been created to generate the bank holidays JSON for a given year. They need to be then inserted, and modified to take into account any additions/modifications made by proclamation.

Run the rake task like this:

bundle exec rake bank_holidays:generate_json[2016]

Canonical sources