This has already been discussed, but I still can’t for the life of me decipher what I’m doing wrong. Previous thread: Trying to filter data files based upon a date field
I want to filter out events that have already happened on my site. I’m trying this:
{{ $shows := where .Site.RegularPages "Section" "shows" }}
{{ range where $shows "Params.showDate" "gt" now }}
and in the frontmatter of a exampleshow.md:
---
showDate: 2023-12-21T00:29:49.000Z
---
I have tried a bunch of different formats for showDate
but nothing seems to be working. The only thing I could get to work was by converting the dates to Unix timestamps, but then time.Format doesn’t know how to decode the time (for display in the page), so that’s not very helpful.
Indirectly related, I am setting this up with Decap CMS, so I can use their dateTime widget to set the showDate
, but I don’t know what format I need to use. Widgets | Decap CMS | Open-Source Content Management System
WIP repo is at: GitHub - schaefsteven/rocky-hutchins at testing