ballotnav
ballotnav copied to clipboard
Open Now/Closed label on locations
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.
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
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.)
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.
if hours or continuous are not chosen and description is, use the words in the associated text field and hide the open/closed state.
Please provide update
- Progress so far
- Any roadblocks?
- Availability to complete issue
- ETA for issue to be completed
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.
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.