Skip to content

Conversation

@denisyilmaz
Copy link

new query arguments:

  • startsAfterDate
  • endsBeforeDate
  • isDuringDate
  • isNotDuringDate

Copy link

@Coysh Coysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janhenckens - I'm looking for a way to query a specific date range (i.e. any event happening in October 2025) - would this feature request sort that?

@denisyilmaz
Copy link
Author

denisyilmaz commented Sep 22, 2025

@Coysh we are using these new queries in our fork for a while now in production and yes, it would be able to query for a specific date range:

Example:

query GetEvents {
  entries(
    section: "events"
    isDuringDate: ["2025-10-01 => 2025-10-31", "dateTimeRange", "event"]
  ) {
    ...Event
  }
}

You can check a live example here: https://www.urbanekuensteruhr.de/en/calendar (check the network tab when switching between months)

@Coysh
Copy link

Coysh commented Sep 22, 2025

@denisyilmaz - Thanks I'm using it in a module - so something like $query->isDuringDate("2025-10-01 => 2025-10-31", "dateTimeRange", "event"]) would work I guess

@denisyilmaz
Copy link
Author

@Coysh yes, should work the same way.

@Coysh
Copy link

Coysh commented Sep 29, 2025

For anyone interested, I've got a fork with a startsWithinDateRange as I needed a way to find entries which started within a specific month:

https://github.com/Coysh-Digital/craft-date-range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants