Download the PHP package insight-media/statamic-opening-hours without Composer
On this page you can find all versions of the php package insight-media/statamic-opening-hours. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download insight-media/statamic-opening-hours
More information about insight-media/statamic-opening-hours
Files in insight-media/statamic-opening-hours
Package statamic-opening-hours
Short Description A Statamic addon to manage and display opening hours
License
Homepage https://github.com/insight-media/statamic-opening-hours
Informations about the package statamic-opening-hours
Statamic Opening hours
Set your business' opening hours and exceptional closing times in the Statamic control panel.
Display or query the opening hours in your antler views using the provided openingHours tag.
Features
- Adds an 'opening hours' page to the CP navigation, where you can define multiple opening hours per weekday
- Add exceptional closing times, which override the default opening hours
- Display the opening hours using the provided tag
- Query for open/close status
- Query for next/previous opening hours/closing times
- Uses the Spatie Opening Hours package to perform queries
How to Install
You can search for this addon in the Tools > Addons
section of the Statamic control panel and click install, or run the following command from your project root:
Publish the optional config file.
How to Use
In the Statamic Control Panel
Set your business' opening hours in the Statamic control panel.
In your antlers templates
Use the openingHours tag to display or query opening hours:
Check if currently open:
Check if currently closed:
Check if open on specific weekday:
Check if open on specific date:
Check if open at specific time:
Check if closed on specific weekday:
Check if closed on specific date:
Check if closed at specific time:
Query opening times for specific weekday:
Query opening times for all weekdays:
Query opening times for specific date:
Query exceptional closing times:
Get next opening times
Get next closing times
Get previous closing times
Get the amount of open time (number of hours as a floating number) between 2 dates/times.
Get the amount of open time (number of minutes as a floating number) between 2 dates/times.
Get the amount of open time (number of seconds as a floating number) between 2 dates/times.
Get the amount of closed time (number of hours as a floating number) between 2 dates/times.
Get the amount of closed time (number of minutes as a floating number) between 2 dates/times.
Get the amount of minutes until opening time.
Get the amount of closed time (number of seconds as a floating number) between 2 dates/times.
Important: We recommend using the Antlers runtime parser when working with the openingHours tag.