Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Office Hours

20,540 sites Security covered
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.

Activity

Total releases
7
First release
Feb 2025
Latest release
6 months ago
Releases (12 mo)
1 ▼ from 6
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
8.x-1.29 Stable Dec 30, 2025
8.x-1.28 Stable Apr 19, 2025
8.x-1.27 Stable Apr 3, 2025
8.x-1.26 Stable Mar 24, 2025
8.x-1.25 Stable Mar 24, 2025
8.x-1.24 Stable Mar 24, 2025
8.x-1.22 Stable Feb 26, 2025