Utilisateur:A Pirard/work

Une page de Wikipédia, l'encyclopédie libre.

Simplified syntax diagram[modifier | modifier le code]

This is an easier to read diagram covering most cases. Its goal is to allow writing most Opening Hours tags in a short time, not to explain the full syntax. Please refer to the full diagram for special cases and more explanations.

Legend:

  • <element> is to be replaced by the element's syntax definition below
  • boldcase is either written as such and explained below, or chosen from a list or numeric rule below
  • [...] means that ... is optional
  • [something]... means that something can be repeated as needed
  • this | that indicates that one of this or that must be chosen (alternative)

Syntax:

  • opening_hours = <range> [off] [;<range> [off] ]... [1]
  • <range>: open | closed | <daily> | <weekly> | <montly>
  • <daily>: [ Mo [md[-md] [, md[-md]]... ] [ <period> [,<period>]... ]
  • <weekly>: [week we[,we...|-we[/n]]] Wd[-Wd] [ <period> [,<period>]... ]
  • <monthly>: <monthdays> [<weekdays>] [ <period> [,<period>]... ]
  • open: always open, initial state, except the following
  • closed: never open, initial state, except the following
  • off: closing time that overrides previous opening time; if the first range is off, an initial 24/7 is assumed
  • <period>:
  • <weekdays>: Wd[-Wd] [,Wd[-Wd]]... | Wd[x[,x]...] (e.g.: Mo-Fr 08:00-09:00 or Mo[1,3] 08:00-09:00)
  • <monthdays>: Mo-Mo:
  • hh: hours note: always two digits number, in 24h format (no am/pm)
  • mm: minutes note: always two digits number (e.g.: Fr 08:30-20:00)
  • Mo: Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec : month (e.g.: Dec 25)
  • md: monthday note: always two digits number (e.g.: Dec 25)
  • Wd: Mo | Tu | We | Th | Fr | Sa | Su : weekday (e.g.: Fr 08:30-20:00)
  • we week number note: always a two digit number in range 01-53 (e.g.: week 25 Mo 08:30-20:00)
  1. if all ranges are followed by "off", an initial "always" period is assumed. (Not true for any implementation that I know of. -- User:Ypid)