Hourly checkouts get marked as overdue, even though they are not

Bug #1951024 reported by Jane Sandberg
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Undecided
Unassigned

Bug Description

We've been experiencing the following issue:

1) Check out an hourly checkout to a patron (for us, these are items that are due back after 2 hours)
2) Go to the Items Out tab
3) Note that the row for the newly checked out item is red, with the styling intended for overdue items

I haven't dug into this yet, but I wonder if there is a timezone issue (e.g. the javascript is trying to compare two times, and it thinks that a local timezone time is actually a GMT one). Or if something is going wrong with parsing the due date prior to the comparison.

Revision history for this message
Dan Guarracino (dguarracino) wrote :

I've run into this, too, on 3.6.4. I meant to report this when I encountered it a few weeks ago. Here are my notes; not sure if this is the right track or not:

I think the issue is here: Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js

The row is being highlighted if the due date is before "now". However, the "now" date it's checking against is the date in UTC, so it's checking against a timestamp that's four hours ago.

new Date().toISOString() gives the time in UTC.

I tried checking out an item with an hourly circ on our test server. The item was not highlighted when the item was due in 4 hours, but became highlighted once the item was at or less than 3:59 from its due date. (Your results may differ -- we are in EST, but I wrote this while we were in EDT).

Problem begins on line 92:

    $scope.colorizeItemsOutList = {
        apply: function(item) {
            var duedate = item.due_date();
            if (duedate && duedate < new Date().toISOString()) {
                return 'overdue-row';
            }
        }
    }

Revision history for this message
Michele Morgan (mmorgan) wrote :

Coincidentally, we just had a report of this yesterday. We're also on 3.6.4 and seeing exactly what Dan is describing. Marking Confirmed.

Changed in evergreen:
status: New → Confirmed
Revision history for this message
Jason Boyer (jboyer) wrote :

Jane is right that it's timezone related. In items_out.js the colorizeItemsOutList function compares the string version of the current due date with the output of 'new Date().toISOString()' which will always be in GMT. A quick poke around the JS console makes it look like all you need to do is change the duedate variable assignment in that function to 'new Date(item.due_date()).toISOString()' rather than just item.due_date() to line up both timezones.

tags: added: bitesize
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.