ballotnav icon indicating copy to clipboard operation
ballotnav copied to clipboard

Open Now/Closed label on locations

Open jmensch1 opened this issue 3 years ago • 6 comments

Overview

The designs call for a green "Open Now" label when a location is open at the time the user is checking our site. Presumably we also want a red "Closed" label if the location is closed. We need to implement this feature.

image

Note that there are three types of schedules: "hours", "continuous", and "description". The type can be found in the scheduleType field of the location object, and the relevant open/close dates and times are found elsewhere in that object. We won't be able to offer this feature for "description" types since the times are simply given as a text string.

Also, the times in the location object are local (i.e. in the time zone of the location) and the locations have a timezone field that contains a string, e.g. "US/Eastern".

Keep in mind that the user might not be in the same timezone as the location. Also, remember that it might be daylight savings time. And then try not to shoot yourself.

Action Items

  • [ ] Write an algorithm that determines whether a "continuous" location is currently open
  • [ ] Write an algorithm that determines whether an "hours"-type location is currently open
  • [ ] Figure out what the UI should display for "description"-type locations

Resources/Instructions

https://www.figma.com/file/dvtVjMEBqj34a0tv5WEbMd/Ballotnav?node-id=1107%3A30874

jmensch1 avatar Nov 24 '20 20:11 jmensch1

If it would help / make things easier, we can have pgsql convert the "continuous" and "hours" types into proper timestamps (either in UTC or with the value-effective local offset) assuming that we have a timezone on record.

But do keep in mind that we might not necessarily have the timezone on record, so it's possible that continuous or hours would need to be rendered without the open/closed indicator. (Is very likely to happen in cases where counties have internal timezone splits.)

aNullValue avatar Dec 03 '20 03:12 aNullValue

Ugh, I didn't even think about timezone splits within a single county...

Based on https://gaballotdropbox.org/ and what I'm hearing from Randall and Karen, it's looking like GA counties are mostly 24/7 drop-boxes. So maybe we can dodge this issue for the GA launch. Let's see what the GA data looks like and adjust our UI accordingly.

jmensch1 avatar Dec 03 '20 18:12 jmensch1

if hours or continuous are not chosen and description is, use the words in the associated text field and hide the open/closed state.

ExperimentsInHonesty avatar Mar 24 '21 01:03 ExperimentsInHonesty

Please provide update

  1. Progress
 so far
  2. Any roadblocks?
  3. Availability
 to complete issue
  4. ETA for issue to be completed

kcoronel avatar Mar 30 '21 02:03 kcoronel

I have the development environment spun up and received the Mapbox token from Jake.

No roadblocks so far. I estimate to have this completed either this weekend or next.

alligatormonday avatar Mar 30 '21 04:03 alligatormonday

Issue relates to v1 of the project. Currently not pursuing this format of the product. You can find a link to all the issues that have this designation, here.

kcoronel avatar Apr 05 '22 21:04 kcoronel