The time an item is due does not display on the patron's record in the OPAC.
Created attachment 27551 [details] [review] Bug 9723 - Hourly loans don't show time due in OPAC Due dates in the OPAC don't display the time items are due, and thus items which are on hourly loans don't display an accurate due date and time. This patch corrects this by adding the "with_hours => 1" parameter. To test, enable an hourly loan period for an itemtype in your collection. View the display of date due on the following pages: - Patron details (opac-user.pl) - Log into the OPAC as a user who has something checked out which circulates by the hour. - Bibliographic details (opac-detail.pl) - View the details for an item which is circulates by the hour and is checked out. - Course reserves details (opac-course-details.pl) - View the contents of a course reserve, one of which should be an item which circulates by the hour and is checked out. All due dates should show both date and time and be formatted correctly. Test in both prog and Bootstrap themes. This solution is less than ideal for libraries who do not use hourly loans, as the time information is useless and potentially confusing. It's problematic even for libraries who do use hourly loans, since probably not all loans are hourly. However, without doing a check of each item's circulation policy every time we display the due date I don't know how you can tell it's an hourly loan. Assume that items due at 23:59 are non-hourly?
(In reply to Owen Leonard from comment #1) > However, without doing a check of each item's circulation policy every > time we display the due date I don't know how you can tell it's an > hourly loan. Assume that items due at 23:59 are non-hourly? See bug 11148. The new 'as_due_date' option could be added to the KohaDates TT filter as well, and it does indeed assume that any loans that are due at a time other than 23:59 are hourly. That way, there would be no way to clutter up the due date display for daily loans.
The following diff shows how the TT filter might be updated to add a as_due_date option: diff --git a/Koha/Template/Plugin/KohaDates.pm b/Koha/Template/Plugin/KohaDates.pm index 134712f..37d03af 100644 --- a/Koha/Template/Plugin/KohaDates.pm +++ b/Koha/Template/Plugin/KohaDates.pm @@ -30,7 +30,9 @@ sub filter { return "" unless $text; $config->{with_hours} //= 0; my $dt = dt_from_string( $text, 'iso' ); - return output_pref({ dt => $dt, dateonly => !$config->{with_hours} }); + return $config->{as_due_date} ? + output_pref({ dt => $dt, as_due_date => 1 }) : + output_pref({ dt => $dt, dateonly => !$config->{with_hours} }); } 1;
Created attachment 27555 [details] [review] Bug 9723 - Hourly loans don't show time due in OPAC Due dates in the OPAC don't display the time items are due, and thus items which are on hourly loans don't display an accurate due date and time. This patch corrects this by adding (and using) a new "as_due_date" option to the KohaDates plugin made possible by Bug 11148. Thanks to Galen for providing the changes to KohaDates.pm. To test, enable an hourly loan period for an itemtype in your collection. View the display of date due on the following pages: - Patron details (opac-user.pl) - Log into the OPAC as a user who has something checked out which circulates by the hour. - Bibliographic details (opac-detail.pl) - View the details for an item which is circulates by the hour and is checked out. - Course reserves details (opac-course-details.pl) - View the contents of a course reserve, one of which should be an item which circulates by the hour and is checked out. Due dates for hourly items should show both date and time and be formatted correctly. Due dates for non-hourly loans should show only the date. Test in both prog and Bootstrap themes.
Patch tested with a sandbox, by Aleisha <aleishaamohia@hotmail.com>
Created attachment 27959 [details] [review] Bug 9723 - Hourly loans don't show time due in OPAC Due dates in the OPAC don't display the time items are due, and thus items which are on hourly loans don't display an accurate due date and time. This patch corrects this by adding (and using) a new "as_due_date" option to the KohaDates plugin made possible by Bug 11148. Thanks to Galen for providing the changes to KohaDates.pm. To test, enable an hourly loan period for an itemtype in your collection. View the display of date due on the following pages: - Patron details (opac-user.pl) - Log into the OPAC as a user who has something checked out which circulates by the hour. - Bibliographic details (opac-detail.pl) - View the details for an item which is circulates by the hour and is checked out. - Course reserves details (opac-course-details.pl) - View the contents of a course reserve, one of which should be an item which circulates by the hour and is checked out. Due dates for hourly items should show both date and time and be formatted correctly. Due dates for non-hourly loans should show only the date. Test in both prog and Bootstrap themes. Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
I added the signoff manually. It seems something went wrong on signing off from the sandbox.
Created attachment 28114 [details] [review] Bug 9723 - Hourly loans don't show time due in OPAC Due dates in the OPAC don't display the time items are due, and thus items which are on hourly loans don't display an accurate due date and time. This patch corrects this by adding (and using) a new "as_due_date" option to the KohaDates plugin made possible by Bug 11148. Thanks to Galen for providing the changes to KohaDates.pm. To test, enable an hourly loan period for an itemtype in your collection. View the display of date due on the following pages: - Patron details (opac-user.pl) - Log into the OPAC as a user who has something checked out which circulates by the hour. - Bibliographic details (opac-detail.pl) - View the details for an item which is circulates by the hour and is checked out. - Course reserves details (opac-course-details.pl) - View the contents of a course reserve, one of which should be an item which circulates by the hour and is checked out. Due dates for hourly items should show both date and time and be formatted correctly. Due dates for non-hourly loans should show only the date. Test in both prog and Bootstrap themes. Signed-off-by: Aleisha <aleishaamohia@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Pushed to master. Thanks, Owen!