haxxnz / vaxxnz

NZ COVID Vaccination Finder - community project
https://vaxx.nz
MIT License
82 stars 44 forks source link

Added filter to locations for "Walk-in/Drive Thru" so that only locati… #315

Closed isaacy2012 closed 3 years ago

isaacy2012 commented 3 years ago

…ons available right now are shown

Splits by "to", to get the from and to times, and then uses Regex to split the time into hours, minutes.

Closes #275

Proposed Changes

  1. Added isOpenNow function to check whether a given location is available right now.
  2. Filters locations.ok on whether it is isOpenNow

Additional Info.

Splits by "to", to get the from and to times, and then uses Regex to split the time into hours, minutes.

Screenshots (optional)

netlify[bot] commented 3 years ago

✔️ Deploy Preview for vaxxnz ready!

🔨 Explore the source changes: 63c6f4970f6e2154a459116a5b38e99e931fd099

🔍 Inspect the deploy log: https://app.netlify.com/sites/vaxxnz/deploys/616d060cc172f30007c3f5ff

😎 Browse the preview: https://deploy-preview-315--vaxxnz.netlify.app/

isaacy2012 commented 3 years ago

@noway Thanks! My only reservation that I didn't think of is whether it is good to return false when it can't parse the date correctly. Would it be safer to just assume it is open unless we have enough information to prove it is explicitly closed? i.e default to open rather than default to closed?

noway commented 3 years ago

@isaacy2012 oh yeah, really good point. Let's default to open 👍🏻

isaacy2012 commented 3 years ago

@isaacy2012 oh yeah, really good point. Let's default to open 👍🏻

Done 😃