LP#1917396 - Staff Curbside Scheduling UTC Issues user/mccanna/lp1917396_curbside_timezone_issues_signoff
authorJosh Stompro <stompro@stompro.org>
Fri, 5 Mar 2021 01:09:44 +0000 (19:09 -0600)
committerTerran McCanna <tmccanna@georgialibraries.org>
Thu, 12 Aug 2021 14:01:10 +0000 (10:01 -0400)
commit3ecae883e922f11d65ec68cec9f48c642c9e5789
treef97a735e49f935733a81931b663a901322408fb8
parent6a85751437a44aa318223c9569a58ae05feae15e
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>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/web/js/ui/default/staff/circ/curbside/directives/schedule_pickup.js