lp928937, null date sorting
authorJason Etheridge <jason@esilibrary.com>
Fri, 24 Feb 2012 19:36:16 +0000 (14:36 -0500)
committerMike Rylander <mrylander@gmail.com>
Tue, 20 Mar 2012 16:44:32 +0000 (12:44 -0400)
Changes util.date.db_date2Date so that nulls are not converted into the epoch.
This fixes date sorting in XUL-based lists in the staff client such that unset
dates are listed before actual dates.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/xul/staff_client/chrome/content/util/date.js

index 4ee8918..cf17627 100644 (file)
@@ -46,6 +46,7 @@ util.date.timer_elapsed = function (id) {
 }
 
 util.date.db_date2Date = function (db_date) {
+    if (!db_date) { return db_date; }
     if (typeof window.dojo != 'undefined') {
         dojo.require('dojo.date.stamp');
         return dojo.date.stamp.fromISOString( db_date.replace( /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[\+-]\d{2})(\d{2})$/, '$1:$2') );