PHPackages                             insight-media/statamic-opening-hours - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. insight-media/statamic-opening-hours

ActiveStatamic-addon[Utility &amp; Helpers](/categories/utility)

insight-media/statamic-opening-hours
====================================

A Statamic addon to manage and display opening hours

v3.0.0(3y ago)02263PHPPHP ^8.0

Since Dec 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/insight-media/statamic-opening-hours)[ Packagist](https://packagist.org/packages/insight-media/statamic-opening-hours)[ Docs](https://github.com/insight-media/statamic-opening-hours)[ RSS](/packages/insight-media-statamic-opening-hours/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

  ![Insight Media Logo](https://camo.githubusercontent.com/d17edd606881d859bb6fd3dd2b2c3f8c950b6189120da75b04c1fe1cb16165b0/68747470733a2f2f696e73696768742d6d656469612e62652f696d616765732f67682f6c6f676f2d6c696768742e737667)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
--------

[](#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](https://github.com/spatie/opening-hours) to perform queries

How to Install
--------------

[](#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:

```
composer require insight-media/statamic-opening-hours
```

Publish the optional config file.

```
php artisan vendor:publish --tag=statamic-google-opening-hours-config --force
```

How to Use
----------

[](#how-to-use)

### In the Statamic Control Panel

[](#in-the-statamic-control-panel)

Set your business' opening hours in the Statamic control panel.

### In your antlers templates

[](#in-your-antlers-templates)

Use the openingHours tag to display or query opening hours:

Check if currently open:

```
{{ if {openingHours:isOpen} }}
    We are open
{{ /if }}
```

Check if currently closed:

```
{{ if {openingHours:isClosed} }}
    We are closed
{{ /if }}
```

Check if open on specific weekday:

```
{{ if {openingHours:isOpen on="tuesday"} }}
    We are open on tuesday
{{ /if }}
```

Check if open on specific date:

```
{{ if {openingHours:isOpen on="2022-12-31"} }}
    We are open on 2022-12-31
{{ /if }}
```

Check if open at specific time:

```
{{ if {openingHours:isOpen at="2022-12-31 15:00:00"} }}
    We are open on 2022-12-31 at 15:00:00
{{ /if }}
```

Check if closed on specific weekday:

```
{{ if {openingHours:isClosed on="monday"} }}
    We are closed on monday
{{ /if }}
```

Check if closed on specific date:

```
{{ if {openingHours:isClosed on="2023-01-02"} }}
    We are closed on 2023-01-02
{{ /if }}
```

Check if closed at specific time:

```
{{ if {openingHours:isClosed at="2022-12-31 22:00:00"} }}
    We are closed on 2022-12-31 at 22:00:00
{{ /if }}
```

Query opening times for specific weekday:

```
{{ openingHours:forDay day="monday" format="H:i" }}
    {{ from }}-{{ to }}
{{ /openingHours:forDay }}
```

Query opening times for all weekdays:

```
{{ openingHours:forWeek format="H:i" }}
    {{ day }}: {{ hours }} {{ from }}-{{ to }} {{ /hours }}
{{ /openingHours:forWeek }}
```

Query opening times for specific date:

```
{{ openingHours:forDate date="2022-12-14" format="H:i" }}
    {{ from }}-{{ to }}
{{ /openingHours:forDate }}
```

Query exceptional closing times:

```
{{ openingHours:exceptions format="H:i" }}
    {{ day }} {{ hours }} from {{ from }}-{{ to }} {{ /hours }} {{ if reason }}({{ reason }}){{ /if }}
{{ /openingHours:exceptions }}
```

Get next opening times

```
{{ openingHours:nextOpen date="{now format='Y-m-d H:i:s'}" format="Y-m-d H:i:s" }}
```

Get next closing times

```
{{ openingHours:nextClose date="{now format='Y-m-d H:i:s'}" format="Y-m-d H:i:s" }}
```

Get previous closing times

```
{{ openingHours:previousOpen date="{now format='Y-m-d H:i:s'}" format="Y-m-d H:i:s" }}
```

Get the amount of open time (number of hours as a floating number) between 2 dates/times.

```
{{ openingHours:diffInOpenHours from="2022-12-21 10:00:00" to="2022-12-21 13:00:00" }}
```

Get the amount of open time (number of minutes as a floating number) between 2 dates/times.

```
{{ openingHours:diffInOpenMinutes from="2022-12-21 10:00:00" to="2022-12-21 13:00:00" }}
```

Get the amount of open time (number of seconds as a floating number) between 2 dates/times.

```
{{ openingHours:diffInOpenSeconds from="2022-12-21 10:00:00" to="2022-12-21 13:00:00" }}
```

Get the amount of closed time (number of hours as a floating number) between 2 dates/times.

```
{{ openingHours:diffInClosedHours from="2022-12-21 10:00:00" to="2022-12-21 13:00:00" }}
```

Get the amount of closed time (number of minutes as a floating number) between 2 dates/times.

```
{{ openingHours:diffInClosedMinutes from="2022-12-21 10:00:00" to="2022-12-21 13:00:00" }}
```

Get the amount of minutes until opening time.

```
{{ openingHours:diffInClosedMinutes from="{now format='Y-m-d H:i:s'}" to="{ openingHours:nextOpen date="{now format='Y-m-d H:i:s'}" format="Y-m-d H:i:s" }" }}
```

Get the amount of closed time (number of seconds as a floating number) between 2 dates/times.

```
{{ openingHours:diffInClosedSeconds from="2022-12-21 10:00:00" to="2022-12-21 13:00:00" }}
```

**Important**: We recommend using the Antlers runtime parser when working with the openingHours tag.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~75 days

Total

3

Last Release

1146d ago

Major Versions

v1.0.0 → v2.0.02022-12-24

v2.0.0 → v3.0.02023-05-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/251644073?v=4)[Insight Media](/maintainers/insight-media)[@insight-media](https://github.com/insight-media)

---

Top Contributors

[![dries-dekeersgieter](https://avatars.githubusercontent.com/u/6231271?v=4)](https://github.com/dries-dekeersgieter "dries-dekeersgieter (5 commits)")

---

Tags

addonstatamicopening-hoursInsight MediaOpening timesClosing times

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/insight-media-statamic-opening-hours/health.svg)

```
[![Health](https://phpackages.com/badges/insight-media-statamic-opening-hours/health.svg)](https://phpackages.com/packages/insight-media-statamic-opening-hours)
```

###  Alternatives

[statamic/seo-pro

68516.6k](/packages/statamic-seo-pro)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

23111.5k15](/packages/marcorieser-statamic-livewire)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

15133.0k](/packages/withcandour-aardvark-seo)[visuellverstehen/statamic-classify

A useful helper to add CSS classes to all HTML tags generated by the bard editor.

20121.3k](/packages/visuellverstehen-statamic-classify)[justkidding96/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

155.4k](/packages/justkidding96-aardvark-seo)[aerni/livewire-forms

A Statamic forms framework powered by Laravel Livewire

2915.1k](/packages/aerni-livewire-forms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
