LP#1879983: ensure that last slot for day falls before closing time
authorGalen Charlton <gmc@equinoxinitiative.org>
Mon, 15 Jun 2020 14:28:48 +0000 (10:28 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 15 Jun 2020 14:28:48 +0000 (10:28 -0400)
For example, if the library is scheduled to close at 19:00
and offers 15-minute pickup windows, the last slot offered
is now 18:45 rather than 19:00.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Curbside.pm

index 62ddc2e..6a9df9b 100644 (file)
@@ -543,7 +543,7 @@ sub times_for_date {
 
     my $now_obj = DateTime->now; # NOTE: does not need timezone set because it gets UTC, not floating, so we can math with it
     my $step_obj = $start_obj->clone;
-    while (DateTime->compare($step_obj,$end_obj) <= 0) { # inside HOO
+    while (DateTime->compare($step_obj,$end_obj) < 0) { # inside HOO
         if (DateTime->compare($step_obj,$now_obj) >= 0) { # only offer times in the future
             my $step_ts = $step_obj->strftime('%FT%T%z');
             my $other_slots = $e->search_action_curbside({org => $org, slot => $step_ts}, {idlist => 1});