sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
863 stars 43 forks source link

Any way to filter/group by date past or future? #53

Open frankbits opened 1 year ago

frankbits commented 1 year ago

I have events, that dependent on their date get displayed as upcoming events, or as "highlights" with additional videos, images, comments. I would like to easily be able to filter/group for this, to easily edit only future or only past events.

Maybe the filter/group-option could provide "current time/date(day,month,year)"-"template tags", and to compare two/multiple values.

    view_filters:
      - label: 'upcoming Events'
        field: datetime
        greater: '{{currentDate}}'
      - label: 'Highlights'
        field: datetime
        lower: '{{currentDate}}'
    view_groups:
      - label: "upcoming?"
        field: datetime
        compare: '{{currentDate}}'
kyoshino commented 1 year ago

I also have a client having events, and yeah, it makes sense to enhance the view filters/groups. https://github.com/decaporg/decap-cms/issues/3617 has a similar discussion. I could implement eq, lt, gt, in, etc.

frankbits commented 1 year ago

implementing those options sounds good, but to be really useful for this use case they need something like the template tags to compare against.

kyoshino commented 11 months ago

Looks like I need this for my clients managing an event/concert list using Sveltia CMS. Will have a look soonish.

frankbits commented 11 months ago

Looks like I need this for my clients managing an event/concert list using Sveltia CMS. Will have a look soonish.

Same UseCase here🙃