library app-orm-opening-schedule
Opening schedule module for opening hours and holidays
ride/app-orm-opening-schedule
Opening schedule module for opening hours and holidays
- Friday, October 14, 2016
- by ride-user
- Repository
- 12 Watchers
- 0 Stars
- 306 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 4 Versions
- 1 % Grown
Ride app-orm-opening-schedule
This module provides a schedule model which can be hooked to any existing model.
It adds opening hours and holiday support.
There are some helper methods to easily look up opening hours and holidays., (*1)
Example
<model name="Foo">
<field name="schedule" model="OpeningSchedule" relation="belongsTo">
<option name="label.name" value="label.schedule" />
</field>
</model>
{$schedule = {* get schedule from model entry *}}
{$o = $schedule->getCurrentOpeningHour()}
{if $o}
{$o->getStart()->getTimestamp()}
<!-- Create date -->
{$o->getEnd()|date_format:"%A %d-%m-%Y %H:%M"}
{/if}
{$o = $schedule->getNextOpeningHour()}
{$o = $schedule->getOpeningHour($timestamp)}
{$o = $schedule->getOpeningHoursByDay(2)}
{$h = $schedule->getCurrentHoliday()}
{if $h}
{$h->getStart()->getTimestamp()}
<!-- Create date -->
{$h->getEnd()|date_format:"%A %d-%m-%Y %H:%M"}
{/if}
{$h = $schedule->getNextHoliday()}
{$h = $schedule->getHoliday($timestamp)}
Installation
You can use Composer to install this application., (*2)
composer require ride/app-orm-opening-schedule
dev-master
9999999-dev
Opening schedule module for opening hours and holidays
Sources
Download
MIT
The Requires
dev-develop
dev-develop
Opening schedule module for opening hours and holidays
Sources
Download
MIT
The Requires
1.0.0
1.0.0.0
Opening schedule module for opening hours and holidays
Sources
Download
MIT
The Requires
0.2.0
0.2.0.0
Opening schedule module for opening hours and holidays
Sources
Download
MIT