Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
This was done for D7 in #728026: Add Views Filter handler for Open/Closed (today/now/soon). I would like to see it added for D8 as well.
I do have two concerns though: 1) Timezone handling, 2) Cache-ing.
Were those addressed for D7?
Comments
Comment #2
ChristopheDG CreditAttribution: ChristopheDG commentedWould be great to have this functionality!
Comment #3
johnvComment #4
johnvComment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedYes. I want to show which stores are open. A views filter would be great
Comment #6
tuthanh CreditAttribution: tuthanh commentedSubscribe
Comment #7
johnvComment #8
johnvComment #9
XTazSubscribe
Comment #10
johnvPlease add a use case, so i can work on it.
Patches are greatly appreciated.
Comment #11
johnvComment #12
johnvComment #13
AlfTheCat CreditAttribution: AlfTheCat commentedYes, much needed. For a collection of stores that do instant delivery, and a nearby businesses directory, there needs to be a way to filter on open / closed.
Comment #14
johnvComment #16
johnvIt took a while...
Above commit adds an open/closed status filter with the following options:
It was tested for authorized and anonymous users (for page_cache module).
The filtering is in the Render phase, so no worries about the caching. Each time a view is refreshed, the status is recalculated.
Note: Timezone handling is not handled at all in this module, despite efforts. That totally depends on the entity's address and user's timezone. A hook is provided, though.