From 6fbbcca096402e099f90702e5f79a98b80bc69a2 Mon Sep 17 00:00:00 2001
From: Galen Charlton <gmc@equinoxinitiative.org>
Date: Fri, 21 Sep 2018 14:58:47 -0400
Subject: [PATCH] LP#1552778: add timepicker to webstaff checkout page

This patch adds a timepicker to go along with the datepicker
if the operator invokes the option to set a specific due
date.

To test
-------
[1] Arrange circ policies to have both hourly and daily loans.
[2] Apply the patch.
[3] Check out an item for an hourly loan. Verify that the
    due date and time is per policy.
[4] Check out an item for a daily loan. Verify that the
    due date is per policy.
[5] Check out an item for an hourly loan, but set a specific
    due date and time. Verify that the due date and time matches
    the selected value.
[6] Check out an item for a daily loan, but set a specific
    due date. Verify that the due date matches the selected
    value; note that any time component is ignored since
    for daily loans the time gets normalized to 23:59.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
---
 Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
index 1db71f15ef..fd56e02b53 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2
@@ -1,7 +1,7 @@
 <!-- item checkout form / list -->
 
 <div class="row pad-vert">
-  <div class="col-md-6">
+  <div class="col-md-5">
     <form ng-submit="checkout(checkoutArgs)" role="form" class="form-inline">
       <div class="input-group">
 
@@ -39,8 +39,8 @@
     <div class="flex-row">
       <div class="flex-cell"></div>
 
-<div class="input-group">
-<div class="input-group-btn" uib-dropdown>
+<div class="form-group row">
+<div class="col-md-3" uib-dropdown>
       <button type="button" ng-class="{'btn-success' : date_options.has_sticky_date}" class="btn btn-default" uib-dropdown-toggle>
         [% l('Date Options') %]
         <span class="caret"></span>
@@ -75,10 +75,8 @@
           [% l('Specific Due Date') %]
         </label>
       </div> -->
-      <!-- FIXME: This needs a time component as well, but type="datetime" 
-            is not yet supported by any browsers -->
-      <div>
-        <eg-date-input ng-model="checkoutArgs.due_date" ng-disabled="!date_options.has_sticky_date"></eg-date-input>
+      <div class="col-md-4">
+        <eg-date-input ng-model="checkoutArgs.due_date" ng-disabled="!date_options.has_sticky_date" show-time-picker></eg-date-input>
       </div>
 </div>
     </div>
-- 
2.11.0