Skip to content

OpeningHoursSpecification for a place that is open past midnight #534

@unor

Description

@unor

On Stack Overflow, devOp asked how to specify opening hours for something that is open past midnight, e.g., a place that is open from 22:00 to 03:00.

I assumed that using something like the following snippet should be fine, as the definitions for closes says it’s the "closing hour of the place or service on the given day(s) of the week" (i.e., yes, it is the closing hour on that day, but it closes what was opened on the previous day):

<div typeof="schema:OpeningHoursSpecification">
  <link property="schema:dayOfWeek" href="http://purl.org/goodrelations/v1#Monday">
  <meta property="schema:closes" content="03:00:00">
  <meta property="schema:opens" content="22:00:00">
</div>

But then I found a mailing list post from Martin Hepp (@mfhepp), where he explains for gr:OpeningHoursSpecification:

opening hours that cross midnight must be broken into two chunks, one opening hour specification for the first day, then closing at 23:59:59, and one for the next day of the week, opening ant 00:00:00

[…]

A consuming client should assume that if the shop closes for only 1 second, it is actually open without interruption.

As schema:OpeningHoursSpecification is derived from this, I assume this advice still holds? Or may the above snippet be used, too?

Either way, I think we should explicitly mention in the description how to handle past midnight opening hours, and add an example for that, too.

Metadata

Metadata

Assignees

Labels

dates times and eventsDescribing times, dates and events (and their relationships)no-issue-activityDiscuss has gone quiet. Auto-tagging to encourage people to re-engage with the issue (or close it!).schema.org vocabGeneral top level tag for issues on the vocabularystatus:work expectedWe are likely to, or would like to, or probably should try, ... to do something in this area.type:cleanup + clarityAddresses wording fixes, ambiguities, confusion, bad examples etc

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions