I\'m creating a Rails app that will store the opening and closing hours for a business. Originally, I thought of simply using a text data type and letting it be free-form:
I would say that Operating Hours belong to a Party Address, and should be represented by an RFC 5455 RRULE and optionally an EXRULE or EXDATEs.
Let's say you have a Party:
"Acme, Inc."
They have one PhysicalAddress:
"123 Main Street, Vancouver"
Their address plays two roles:
"Sales" and "Service"
Sales is open Mo-Sa 10-8 and Service is open Mo-Fr 9-5
These are the RRULES:
(Sales)
startTime:'10:00:00'
endTime:'20:00:00'
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA
(Service)
startTime:'09:00:00'
endTime:'17:00:00'
RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR