StoDevX / AAO-React-Native

The St. Olaf community, now in pocket size.
GNU Affero General Public License v3.0
42 stars 16 forks source link

Support "one off" days in the building hours schedules #2212

Open hawkrives opened 6 years ago

hawkrives commented 6 years ago

I'm thinking something like

schedule: ...

breakSchedules:
  interim:
    first:
      sunday: #schedule
    last:
      monday: #schedule

overrides:
  - date: 2018-01-22
    message: Closing early due to snow
    hours: {open: 8:00am, close: 5:00pm}
  - date: 2018-02-22
    message: Closed!
    hours: {closed: true}
  - dateRange: {start: 2018-03-01, end: 2018-04-01}
    message: Closed for renovations
    hours: {closed: true}

That breakSchedules key would solve my problems with my current breakSchedules stuff (namely, that they don't keep the same hours across the entire break; some early/late days are different [think the caf closing at 6:30 on the last day of finals, and being completely closed during break – although I guess that's not really a break schedule then... {more thought needed}]) by allowing custom schedules on the first / last weekday of a break.

The overrides key (especially when I build the "closed" support, which has its own issue in here somewhere) would let us override the hours on a specific day / date range. The message key would function similarly to the new notice / message stuff I have in the building hours for 2.5, where it will show on the list view.

hawkrives commented 6 years ago

Or, what if breakSchedules and overrides got combined?

Let's say that there's a break from Jan. 1 to Jan. 10, but the library is operating differently on the first two days.

overrides:
  - break: christmas 
    message: # defaults something about the break?
    schedules: # day-based schedules, like in the normal config
  - date: 2018-01-01
    message: Closed until Jan. 2nd
    hours: {closed: true}
  - date: 2018-01-02
    message: Special hours
    hours: 
      - {open: 800am, close: 200pm}
      - {open: 4pm, close: 6pm}

And then both dateRange and break overrides would use "schedules", and "date" would use "hours" to indicate that it can only specify hours since you already have it a date.

hawkrives commented 6 years ago

I've whipped up some examples:

name: The Pause Kitchen
image: pause-kitchen
category: Food

schedule:
  - title: Daylight
    notes: The late night menu starts at 9 p.m.
    hours:
      - {days: [Mo], from: '10:30am', to: '12:00am'}
      - {days: [Tu], from: '11:30am', to: '12:00am'}
      - {days: [We], from: '10:30am', to: '12:00am'}
      - {days: [Th], from: '11:30am', to: '12:00am'}
      - {days: [Fr], from: '10:30am', to: '9:00pm'}
      - {days: [Sa], from: '11:30am', to: '9:00pm'}
      - {days: [Su], from: '11:30am', to: '12:00am'}

  - title: Late Night
    hours:
      - {days: [Fr, Sa], from: '9:00pm', to: '2:00am'}

overrides:
  - period: interim
    schedule:
      - title: Daylight
        hours:
          - {days: [Mo], from: '10:45am', to: '11:00pm'}
          - {days: [Tu], from: '11:30am', to: '12:00am'}
          - {days: [We], from: '10:45am', to: '12:00am'}
          - {days: [Th], from: '11:30am', to: '11:00pm'}
          - {days: [Fr], from: '11:30am', to: '9:00pm'}
          - {days: [Sa], from: '11:30am', to: '9:00pm'}
          - {days: [Su], from: '11:30am', to: '11:00pm'}

      - title: Late Night
        hours:
          - {days: [Fr, Sa], from: '9:00pm', to: '2:00am'}

  - period: summer
    notice: The Pause Kitchen is closed for the summer.
    schedule:
      - closed: true

  - period: 2018-01-01
    notice: The Pause Kitchen is closed to prepare for an event.
    schedule:
      - closed: true

  - period: {start: 2018-01-01, end: 2018-01-31}
    notice: The Pause Kitchen is closed due to remodeling.
    schedule:
      - closed: true
name: The Cage
image: cage
category: Food

schedule:
  - title: Kitchen
    notes: The kitchen stops cooking at 8 p.m.
    hours:
      - {days: [Mo, Tu, We, Th, Fr], from: '7:30am', to: '8:00pm'}
      - {days: [Sa, Su], from: '9:00am', to: '8:00pm'}

overrides:
  - period: summer
    schedule:
    - title: Kitchen
        hours:
          - {days: [Mo, Tu, We, Th], from: '7:30am', to: '3:00pm'}
          - {days: [Fr], from: '7:30am', to: '1:00pm'}
name: Stav Hall
image: stav
category: Food

schedule:
  - title: Breakfast
    hours:
      - {days: [Mo, Tu, We, Th, Fr, Sa], from: '7:00am', to: '9:45am'}
      - {days: [Su], from: '8:30am', to: '10:15am'}

  - title: Lunch
    hours:
      - {days: [Mo, Tu, We, Th, Fr], from: '10:30am', to: '2:00pm'}
      - {days: [Sa, Su], from: '11:00am', to: '1:30pm'}

  - title: Dinner
    hours:
      - {days: [Mo, Tu, We, Th, Fr, Sa, Su], from: '4:30pm', to: '7:30pm'}

overrides:
  - period: summer
    notice: Academic year meal plans are not in effect.
    schedule:
      - closed: true

  - period: interim
    schedule:
      - title: Breakfast
        hours:
          - {days: [Mo, Tu, We, Th, Fr, Sa], from: '7:00am', to: '9:45am'}
          - {days: [Su], from: '8:30am', to: '10:15am'}

      - title: Lunch
        hours:
          - {days: [Mo, Tu, We, Th, Fr], from: '10:45am', to: '1:30pm'}
          - {days: [Sa, Su], from: '11:00am', to: '1:30pm'}

      - title: Dinner
        hours:
          - {days: [Mo, Tu, We, Th, Fr, Sa, Su], from: '4:30pm', to: '7:00pm'}

Thoughts?

drewvolz commented 6 years ago

I want this

hawkrives commented 6 years ago

lol