This is a proposal for a compact specification of opening hours as a data model. This spec aims to store opening hours as a map of strings following this grossly oversimplified regular expression pseudocode:
(date_interval)?(day,?)+=(time_interval,?)*
Where:
date_interval: an (optional) interval of dates where one (but not both) may be optional. Defines the interval of dates where your hours apply, including the start and excluding the end of the interval: 0101-0102 includes Jan 1 to Jan 31, both inclusive.
\[date?-date?\]
day: a day of the week or a concrete date
Mon|Tue|Wed|Thu|Fri|Sat|Sun|date
date: a day in format ddMM with two digits for the day (01-31) and two for the month (01-12)
\d\d\d\d
time_interval: a time interval in format HH:mm using two digits for the hour (00-23) and two for the minutes (00-59). If no interval is specified it is understood to be closed.
\d\d:\d\d
We'll get into that at some point. So far this is just a quick'n dirty idea, so feel free to sling feedback in the comments.