I\'m currently trying to work out the best way to store a business\' hours of operation in a database.
For example:
Business A has the following hours of ope
Most of results works fine for the given scenario, but it wont be as effective if you have periods that runs through multiple days, eg. 8:00 AM ~ 2:00 AM, then I recommend using a multi period design.
0: [
id: 1,
business_id: 1,
open: true,
day: 1,
periods: [
0: { open: 08:00, close: 23:59 }
]
],
1: [
id: 2,
business_id: 1,
open: true,
day: 2,
periods: [
0: { open: 00:00, close: 02:00 }
1: { open: 08:00, close: 23:59 }
]
]