Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Simplify logic for building/parsing LibCal & R25 space schedules #108

Merged
merged 9 commits into from
Mar 14, 2019

Conversation

cappadona
Copy link
Contributor

@cappadona cappadona commented Mar 14, 2019

Still need to pull out common core, but added TODO for further refactoring at later date (#109).

Redundant to parent key but a common pattern and should be useful in
simplifying logic for updating store with parsed schedule/availability.
No need to parse/build if filtering leaves us with no eligible bookings.
Fixes bug introduced when removing whileOpen filter in #101.

The unexpected side-effect of that change was that bookings which
started the previous day but ran into the current day (including a
booking that ends at Midnight) were no longer being filtered out so the
available since opening test was failing due to an index shift (from 0
to 1). This resulted in an incorrect opening time of 12am being
displayed for any space where there was booking from the previous day
which ran until midnight). Clear as mud...

Don't fret, this is only a temporary bandage until we refactor for early
morning closings in #89.
Utilize `Object.assign()` to add any/all new keys to existing store
instead of explicitly setting the schedule.
Department of redundancy reducing department...
Still need to revisit these pieces and pull out the rest of the reusable
bits into a shared core but this is a good start.
Thanks to refactoring from previous commit (d2996d9).
@cappadona cappadona self-assigned this Mar 14, 2019
@cappadona cappadona merged commit c15da10 into master Mar 14, 2019
@cappadona cappadona deleted the spaces-logic-remix branch March 14, 2019 16:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant