1

I'm building a site with Netlify CMS, Eleventy and Nunjucks. I'm having trouble with date formatting for future, non-current dates -- the site is for a local band advertising their show dates.

The date shows up as the standard ISO format despite config.yml specifying another format.

My config.yml for this collection:

  - name: 'gigs'
    label: 'Shows'
    folder: 'src/gigs'
    create: true
    slug: '{{month}}-{{day}}-{{venue}}'
    fields:
    - { label: 'Layout', name: 'layout', widget: 'hidden', default: '_includes/gig.njk' }
    - { label: 'Date', name: 'date', widget: 'datetime', default: '', date_format: 'dddd MMMM Do', time_format: 'ha', format: 'YYYY-MM-DDTHH:mm:ssZ', picker_utc: false }
    - { label: 'Time', name: 'time', widget: 'string', default: '' }
    - { label: 'Venue', name: 'venue', widget: 'string', default: '' }
    - { label: 'City', name: 'city', widget: 'string', default: '' }
Molly
  • 23
  • 2
  • 7
  • Looks like the `format` key in your config is set to `'YYYY-MM-DDTHH:mm:ssZ'`, which looks like the ISO format. Is this what you're referring to? – person_v1.32 Jun 01 '22 at 05:16
  • I added that because I was testing what the `format` field meant.. when I didn't have that field it still showed up as ISO. I'm trying to get it to format based on the `date_format` and `time_format` specifications. – Molly Jun 04 '22 at 17:22

0 Answers0