Last active
August 29, 2015 14:20
-
-
Save mathollingsworth/184a1e9d170705867fde to your computer and use it in GitHub Desktop.
Craft Store Hours Open / Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set arrayPosition = now|date('w') %} | |
{% set today = openingHours.storeHours[arrayPosition] %} | |
{% set tomorrow = openingHours.storeHours[arrayPosition > 6 ? 0 : arrayPosition + 1] %} | |
<p class="u-mb0 text--center"> | |
{% if today.open.getTimestamp() < now.getTimestamp() and today.close.getTimestamp() > now.getTimestamp() %} | |
<a href="{{ siteUrl }}menu" class="c--brand-secondary">Open today til late</a> | |
{% else %} | |
<a href="{{ siteUrl }}menu" class="c--brand-secondary">Open tomorrow at {{ tomorrow.open.localeTime }}</a> | |
{% endif %} | |
</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment