LP#1917396 - Staff Curbside Scheduling UTC Issues user/stompro/lp1917396_curbside_timezone_issues
authorJosh Stompro <stompro@stompro.org>
Fri, 5 Mar 2021 01:09:44 +0000 (19:09 -0600)
committerJosh Stompro <stompro@stompro.org>
Fri, 5 Mar 2021 01:09:44 +0000 (19:09 -0600)
commit3e18171fc35f520c0b69914dc6e6fb305b4dc565
tree3230860513b997c23e7c86d03f3a7afc55f9bd87
parentbfc55503c292104289e1b31d49d323950b1bb436
LP#1917396 - Staff Curbside Scheduling UTC Issues

When a staff person tries to schedule curbside appointments
after their UTC equivalent time moves to the next day, the
timeslots for the next day are shown, and appointments get
made for the next day.

For example, when CST is the local timezone (UTC-6), after 6pm
appointments for the current day are scheduled for the next day.
Appointments for the next day get scheduled for the day after.

This happens because toISOString is used to grab the current date,
but toISOString always returns UTC time.  The date widget will show
the correct date, but the time slots will actually be for the next
day.  This is more noticeable if days have different schedules.

Another clue is that the time slot selector will show all timeslots for
the day, not just the ones that are upcoming.

Testing Plan:

1. Enable curbside for test location, and set org unit hours to
   be at least through 8pm for open hours.

2. Wait until after 4PM (Pacific), 6pm CST, 7PM EST, or
   change your computer clock.

3. Try to schedule an appointment for the current day.

4. The appointment should get scheduled for the next day.

5. Apply the fix.

6. Try to schedule another appointment and see that the correct
   date gets selected.

Signed-off-by: Josh Stompro <stompro@stompro.org>
Open-ILS/web/js/ui/default/staff/circ/curbside/directives/schedule_pickup.js