Hard due dates will not work if ceiling date is the same date as checkout,

Bug #1178802 reported by Steve Callender
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.0
Fix Released
Medium
Unassigned

Bug Description

When using Hard Due Dates, ( Admin > Server Administration > Hard Due Date Changes), if the "Current Ceiling Date" falls on the same day the checkout is being made, the hard due date is skipped.

The reason is because the ceiling date is stamped in the database with the time 00:00:00 (12:00AM). So anything checked out on that day has already passed the hard due date time and the hard due date is considered no longer valid. This makes the last day of the hard due date virtually non-existant.

The time cannot be selected from the hard_due_date screen, it will only allow a date. As a temporary fix, folks that have used this I have manually updated the time in the database to read 23:59:00.

The code that checks if the due_date has passed should really just omit the time portion of the field. It should just if the actual date part is greater than the current date. This would allow the hard due date to be valid up until the day of.

Revision history for this message
Steve Callender (stevecallender) wrote :

Sidenote, it looks like all versions of EG since hard due dates were implemented have this issue. I was testing on a 2.2.5 system, but it also looks to be an issue in the newest release as well.

Ben Shum (bshum)
Changed in evergreen:
status: New → Incomplete
status: Incomplete → Triaged
importance: Undecided → Medium
Revision history for this message
Steve Callender (stevecallender) wrote :

I do believe that this has been fixed. Doing some testing on a 2.4.0 system I am seeing that now the hard due dates ceilings are being stamped with the proper 23:59 time so that you can now set a hard due date on the same day of the ceiling date. I think this can be closed out.

Revision history for this message
Steve Callender (stevecallender) wrote :

Actually, I need to retract that. It's not fixed, what I was looking at was a system that was manually fixed via SQL. This problem still exists and makes it impossible to set a hard due date on the same day as the active date.

Joan Kranich (jkranich)
Changed in evergreen:
status: Triaged → Confirmed
Revision history for this message
Joan Kranich (jkranich) wrote :

Confirmed in 2.5.5 and as noted the time stamp of 12:00AM occurred in past releases. We became aware of the time stamp in hard due dates of 12:00AM since 2.3.

C/W MARS uses both types of Hard Due Dates. The Always Use setting is used for Faculty and the other is a cutoff date for Students where we do not check Always Use. I have found the time stamp of 12:00AM helpful for the cutoff dates that may need to change on a day I am not in the office or on a Saturday. I can leave the date in place and checkouts for Students will revert to their regular standard circulation policies. For Faculty libraries change the semester date in advance of the current semester date so that is not a problem. I have the hard due date set to the new date well in advance. The ability to edit both date and time in the client Hard Due Dates would be good for all situations.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

I guess it comes down to what desired behavior is. My quick read of the comments suggests that a possible fix would be to 23:59:59 (11:59 pm) as the time portion of the due date, thus making the item due at the end of the day.

I would speculate that there are possibly two reason for 12:00 am being used:

1) The date with no time is being inserted, so the database adds the time of 00:00.

2) The date with time of 00:00 (12:00 am) is being deliberately used because hard due dates are meant to reference the future and the intention was to guarantee that they are not just due, but overdue, immediately on that day.

Revision history for this message
Galen Charlton (gmc) wrote :

A patch is available at the tip of the user/gmcharlt/lp1178802_munge_ceiling_dates branch:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/gmcharlt/lp1178802_munge_ceiling_dates

The approach I took was to have the hard due date editor coerce ceiling dates to end at 23:59:59 upon creating or editing a hard due date or a hard due date value. This leaves open the possibility that the eventual Angular interface for editing hard due dates will use a date/time picker instead of just a date picker (Dojo, alas, doesn't have a convenient date/time picker, just separate date and time pickers.)

Revision history for this message
Galen Charlton (gmc) wrote :

Also note that I had considered using Moment's endOf('day') function, but decided to stick with pure Dojo to ease potential backporting to 2.12.x.

tags: added: circ pullrequest
Changed in evergreen:
milestone: none → 2.12.6
Andrea Neiman (aneiman)
Changed in evergreen:
milestone: 2.12.6 → 3.0-beta2
Andrea Neiman (aneiman)
Changed in evergreen:
milestone: 3.0-beta2 → 2.12.6
Changed in evergreen:
milestone: 2.12.6 → 2.12.7
Changed in evergreen:
milestone: 2.12.7 → 2.12.8
Revision history for this message
Michele Morgan (mmorgan) wrote :

I tested this and it looks good to me. Here's my signoff branch:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/mmorgan/lp1178802-signoff

I tested the following scenarios:

-Set a ceiling date in the past and the rolling due date applied at checkout

-Set a ceiling date in the future and the hard due date applied

-Set a ceiling date of today and the hard due date applied

All above scenarios were tested with Always apply set to TRUE as well as Always apply set to FALSE

Also tested Hard Due Date Values as follows:

Set a Hard Due Date Value with a ceiling date of today and an active date of today

Ran the hard due date updater and the ceiling date was updated to today

At checkout the hard due date applied, making the due date today.

tags: added: signedoff
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master, rel_3_0, and rel_2_12. Thanks for testing, Michele!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
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.