{"id":28656067,"url":"https://github.com/offline-gmbh/oc-opening-hours-plugin","last_synced_at":"2025-06-13T08:10:15.206Z","repository":{"id":37736094,"uuid":"196570076","full_name":"OFFLINE-GmbH/oc-opening-hours-plugin","owner":"OFFLINE-GmbH","description":":clock3: Manage and display opening hours on your website","archived":false,"fork":false,"pushed_at":"2025-03-25T16:40:49.000Z","size":105,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T02:16:35.479Z","etag":null,"topics":["octobercms","octobercms-plugin","opening-hours"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OFFLINE-GmbH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-12T11:45:32.000Z","updated_at":"2025-03-25T16:40:52.000Z","dependencies_parsed_at":"2022-09-01T04:11:54.337Z","dependency_job_id":null,"html_url":"https://github.com/OFFLINE-GmbH/oc-opening-hours-plugin","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/OFFLINE-GmbH/oc-opening-hours-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Foc-opening-hours-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Foc-opening-hours-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Foc-opening-hours-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Foc-opening-hours-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OFFLINE-GmbH","download_url":"https://codeload.github.com/OFFLINE-GmbH/oc-opening-hours-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OFFLINE-GmbH%2Foc-opening-hours-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259606992,"owners_count":22883565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["octobercms","octobercms-plugin","opening-hours"],"created_at":"2025-06-13T08:10:14.518Z","updated_at":"2025-06-13T08:10:15.174Z","avatar_url":"https://github.com/OFFLINE-GmbH.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oc-opening-hours-plugin\n\n\u003e Manage and display opening hours on your website.\n\n## Features\n\nThis plugins allows you to store opening hours for multiple locations and display them on your website.\n\nIt makes use of the great [`spatie/opening-hours`](https://github.com/spatie/opening-hours) library. You have direct access to all of the library's features.\n\n* Store opening hours for multiple locations\n* Set opening hours for each day of the week\n* Add exceptions for specific dates\n* Display the opening hours on your website\n* Schema.org compatible [example markup](components/openinghours/) provided\n\n\n## `OpeningHours` component\n\nThis plugin provides only a single `OpeningHours` component. It can be used to display all opening hours for all locations.\n\n```twig\n[openingHours]\n==\n{# List all locations #}\n{% for location in openingHours.locations %}\n\t{{ dump(location.openingHours.forWeek()) }}\n{% endfor %}\n\n{# If you have only a single location you can access it directly #}\n{{ dump(openingHours.location.openingHours.forWeek()) }}\n\n{# You can also access a specific location by its slug #}\n{{ dump(openingHours.locationsBySlug['your-location'].openingHours.forWeek()) }}\n```\n\nAccess the `openingHours` property on any location to have access to the full `spatie/opening-hours`\nfeatureset as [documented in their README](https://github.com/spatie/opening-hours#openinghoursforweek-spatieopeninghoursopeninghoursforday).\n\n```twig\n{{ dump(location.openingHours.forWeek()) }}\n{{ dump(location.openingHours.forWeekCombined()) }}\n{{ location.openingHours.asStructuredData() | json_encode }}\n{{ location.openingHours.forDay('monday') }}\n{{ location.openingHours.isOpenOn('monday') ? 'open' : 'closed' }}\n{{ location.openingHours.isClosedOn('monday') ? 'closed' : 'open' }}\n{{ location.openingHours.forDate(date('2020-01-01')) }}\n{{ location.openingHours.isOpenAt(date('2020-10-01')) ? 'open' : 'closed' }}\n{{ location.openingHours.isOpen() ? \"We're open!\" : \"Sorry, we're closed!\" }}\n{{ location.openingHours.isClosed() ? \"Sorry, we're closed!\" : \"We're open!\" }}\n{{ \"Open until \" ~ location.openingHours.nextClose(date('now')).format('Y-m-d H:i') }}\n{{ \"We'll open again on \" ~ location.openingHours.nextOpen(date('now')).format('Y-m-d H:i') }}\n```\n\nCheckout the [component's partials](components/openinghours/) for a demo implementation.\n\n\n\n## Contributing\n\n### Bugs and feature requests\n\nIf you found a bug or want to request a feature please file a GitHub issue.\n\n### Pull requests\n\nPRs are always welcome! Open them against the `master` branch.\nIf you plan a time consuming contribution please open an issue first and describe what changes you have in mind. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffline-gmbh%2Foc-opening-hours-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffline-gmbh%2Foc-opening-hours-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffline-gmbh%2Foc-opening-hours-plugin/lists"}