specification icon indicating copy to clipboard operation
specification copied to clipboard

Multiple opens_at / closes_at times within schedule?

Open greggish opened this issue 8 years ago • 4 comments

via @derekfidler's comment on our ReadTheDocs:

We've found from working with shelters and other services for the homeless that many services have multiple opens_at and closes_at times within a single day. We've created multiple opens_at/closes_at for each schedule.

Not sure if this would be a schema change or if there can just be guidance in the definition.

greggish avatar Nov 02 '17 11:11 greggish

We will definitely need this once we expand to the middle east where my understanding is that businesses often close at lunch.

rasmus-storjohann-PG avatar Nov 14 '17 22:11 rasmus-storjohann-PG

I was doodling on what a wire representation might look like, supporting both the time range of applicability and multiple opening hours in the same day. Need better names for the two "hours" nodes. I also realize that using the wire format as part of the discussion of the storage spec is a little backwards, but I think this outlines what I think our use case will be.

  • schedule: array of
    • applies_from_date: date (default to constant date in distant past)
    • applies_until_date: date (default to constant date in distant future)
    • hours: array of
      • weekdays: array of
        • values from enum {Mo, Tu, We, Th, Fr, Sa, Su}
      • hours: array of
        • open_from_time: time of day
        • open_until_time: time of day

Example:

schedule: [
    {
        applies_from_date: 2017-12-10,
        applies_until_date: 3000-12-31,
        hours: [
            {
                weekdays: ["Mo", "We", "Fr"],
                hours: [
                    {
                        open_from_time: 09:00,
                        open_until_time: 13:00
                    },
                    {
                        open_from_time: 16:00,
                        open_until_time: 21:00
                    }
                ]
            },
            {
                weekdays: ["Sa", "Su"],
                hours: [
                    {
                        open_from_time: 10:00,
                        open_until_time: 17:00
                    }
                ]
            }
        ]
    }
]

rasmus-storjohann-PG avatar Nov 15 '17 00:11 rasmus-storjohann-PG

Schema.org has a good terse approach openingHours which we should explore.

From their docs:

  • Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su.
  • Times are specified using 24:00 time. For example, 3pm is specified as 15:00.
  • Here is an example: <time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time>.

This doesn't allow HSDS to handle the question of 'will the service be open on X day three weeks in the future' - but I'm not certain we should try and capture that - as that is something that systems will vary in their capacity to cope with. Instead, we might want to see a responsible system consuming data (a) checking back regularly with the authoritative source to see if the latest current opening hours have changed; (b) advising users on when it was last updated.

timgdavies avatar Dec 19 '17 18:12 timgdavies

This is also related to #167

timgdavies avatar Dec 19 '17 18:12 timgdavies

Closing, as I believe this has been addressed in #167 with the adoption of RRULE allowing for multiple different opening and closing times.

mrshll1001 avatar Nov 21 '23 14:11 mrshll1001