-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to use any date for a collection dateRange filter #274
Comments
From my PR: This feature allows the user to specify a custom field to use in the dateRange filter of a collection page. While the same thing is most likely possible to using the Publish and Unpublish Date fields on each child page, this removes the chance of errors and extra fields to fill out. Use case: Display a list of "event" page types that only shows upcoming events. Yaml usage:
|
Thanks for your PR. merged! |
I experienced that when using a custom field for dateRange, it is not properly ordering the items when the european date format is used. For example an items YAML like: header.event.date: 30-03-2017 will somehow be treated as 30/03/2017. Ordering then follows Year -> Month -> Day even if Month = 30 does not exist. Issue does not occur when using default header.date for range. |
@vitopepito could you make a new issue for this bug. I'll see if I can dig in to it tomorrow. |
I'd like to be able to use an arbitrary date attribute (a custom one) on a page to use as the collection filter for list pages. Right now only the "date" field can be used.
I have an "event" page type that has an event.time (datetime) field that I want to only show upcoming events in a listing page.
The text was updated successfully, but these errors were encountered: