store-hours icon indicating copy to clipboard operation
store-hours copied to clipboard

FR: "now open"

Open bartrylant opened this issue 4 years ago • 2 comments

Description

Would be nice to have a template variable to check, to see if the store is open atm (not this day, but this very moment).

bartrylant avatar Jul 23 '20 12:07 bartrylant

Just wondering if anyone has managed to code this functionality manually?

thisisjamessmith avatar Sep 12 '22 09:09 thisisjamessmith

This is what we did as a workaround

{% set currentTime = date() %}
{% set todayHours = entry.<Field>.getToday() %}
{% set isOpen = date(todayHours.open|time) < currentTime and date(todayHours.close|time) > currentTime %}

kculmback avatar Jun 18 '24 18:06 kculmback