Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Office Hours

18,149 sites Security covered Drupal 8–11
View on drupal.org

This module allows you to add a field to content types to display weekly office hours, including exceptions for holidays. It provides options for formatting these hours and indicates whether a location is currently open or closed.

Defines a 'weekly office hours' field type, allowing you add a field to any Content type, in order to display when a location is open or closed on a weekly basis.
In Version 8, you can also add Exception days, specifying a Date.

Please check the Field settings, Formatter settings and Widget settings to explore all features!

See this nice use case, that shows how you can maintain and publish changing opening hours in advance. In the meantime, we are working on #1743366: [Season Meta] Add "Seasonal Hours / Duration" feature

Drupal Modules: The One Percent has posted a nice, but fairly old tutorial (nov 2016)
Lullabot produced a review in their Module Monday series (aug 2014): Module Monday: Office Hours
Or check out the more recent review by Talking Drupal Newsletter #444 from april 2024 (Direct link to video)

Hot topics

Some help is appreciated for the following topics:
Add schema.org/openingHours microdata
Add timezone feature
#3218101: Add PHPUnit tests

Functionalities

    The module defines a field type, and the following widgets:
  • a 'List' widget allows to add a timeslot day by day. (it is not recommended to use this. It is mainly used to test functionality against a close-to-standard widget.)
  • a 'Week' widget shows all days of the week at once,
  • a 'Week with exceptions' allows to additionally add exception dates, where office hours are different from normal weekdays (holiday, Christmas).
    The widget provides:
  • 'allowed hours' restrictions;
  • input validation;
  • use of either a 24 or 12 hour clock;
  • using 1, 2 or even more 'time blocks' per day;
  • a comment per time slot (E.g., 'First friday of the month');
  • links to easily copy or delete time slots.
    The formatter provides:
  • an 'open now'/'closed now' indicator (formatter);
  • options to group days (E.g., "Mon-Fri 12:00-22:00").
  • options to maintain 'Exception days'. (v8.x-1.7)
  • options to display a 'Select List', that can be opened/closed. (v8.x-1.7)
  • integration for openingHours metadata from schema.org
  • integration for openingHoursSpecification metadata from using the Schema.org Metatag module (v8.x-1.6)
  • a hook to alter the formatted time (see office_hours.api.php) (v8.x-1.7).
  • a hook to alter the 'current' time for timezones (see office_hours.api.php) (v8.x-1.7).

This allows you to easily create your own display. For example, next to the 'normal' tabular layout or text format, you can create a view to export the data to a Google Places bulk upload file.

Dependencies

This module depends on the Date module.

Depends on

Dependencies of the latest stable release

  • datetime Drupal core
  • field Drupal core

Required by

3 tracked projects depend on this one

Activity

Tracked releases
10
Tracked since
Jan 2025
Latest release
8 months ago
Releases (12 mo)
1 ▼ from 9
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
8.x-1.29 Stable 8–11 Dec 30, 2025
8.x-1.28 Stable 8–11 Apr 18, 2025
8.x-1.27 Stable 8–11 Apr 3, 2025
8.x-1.26 Stable 8–11 Mar 24, 2025
8.x-1.25 Stable 8–11 Mar 24, 2025
8.x-1.24 Stable 8–11 Mar 24, 2025
8.x-1.23 Stable 8–11 Mar 1, 2025
8.x-1.22 Stable 8–11 Feb 26, 2025
8.x-1.21 Stable 8–11 Jan 15, 2025
8.x-1.20 Stable 8–11 Jan 3, 2025