Logic error trying to merge the date component of one date object with the time compo...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 31 Mar 2011 15:17:19 +0000 (15:17 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 31 Mar 2011 15:17:19 +0000 (15:17 +0000)
This affects Check Out, dedicated Renew interface, and the various date picking functions in Items Out and Holds interfaces.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19917 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/timestamp.js
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/renew.js

index 0c0a8ab..141551c 100644 (file)
@@ -127,13 +127,12 @@ function gen_handle_apply(params) {
 
                 var tp_date = tp.dateValue;
                 var dp_date = dp.dateValue;
-                tp_date.setFullYear( dp_date.getFullYear() );
-                tp_date.setMonth( dp_date.getMonth() );
-                tp_date.setDate( dp_date.getDate() );
+                dp_date.setHours( tp_date.getHours() );
+                dp_date.setMinutes( tp_date.getMinutes() );
 
                 update_modal_xulG(
                     {
-                        'timestamp' : util.date.formatted_date(tp_date,'%{iso8601}'),
+                        'timestamp' : util.date.formatted_date(dp_date,'%{iso8601}'),
                         'complete' : 1
                     }
                 )
index 385e12b..a9319f0 100644 (file)
@@ -576,11 +576,10 @@ circ.checkout.prototype = {
             var dp = obj.controller.view.checkout_duedate_datepicker;
             var tp_date = tp.dateValue;
             var dp_date = dp.dateValue;
-            tp_date.setFullYear( dp_date.getFullYear() );
-            tp_date.setMonth( dp_date.getMonth() );
-            tp_date.setDate( dp_date.getDate() );
+            dp_date.setHours( tp_date.getHours() );
+            dp_date.setMinutes( tp_date.getMinutes() );
 
-            params.due_date = util.date.formatted_date(tp_date,'%{iso8601}');
+            params.due_date = util.date.formatted_date(dp_date,'%{iso8601}');
         }
 
         if (typeof obj.on_checkout == 'function') { obj.on_checkout(params); }
index 6db8455..b0ff2da 100644 (file)
@@ -290,12 +290,11 @@ circ.renew.prototype = {
                 var dp = obj.controller.view.renew_duedate_datepicker;
                 var tp_date = tp.dateValue;
                 var dp_date = dp.dateValue;
-                tp_date.setFullYear( dp_date.getFullYear() );
-                tp_date.setMonth( dp_date.getMonth() );
-                tp_date.setDate( dp_date.getDate() );
+                dp_date.setHours( tp_date.getHours() );
+                dp_date.setMinutes( tp_date.getMinutes() );
 
                 JSAN.use('util.date');
-                params.due_date = util.date.formatted_date(tp_date,'%{iso8601}');
+                params.due_date = util.date.formatted_date(dp_date,'%{iso8601}');
             }