[open-ils-commits] r17150 - trunk/Open-ILS/xul/staff_client/chrome/content/util (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Aug 10 12:16:52 EDT 2010


Author: phasefx
Date: 2010-08-10 12:16:49 -0400 (Tue, 10 Aug 2010)
New Revision: 17150

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/date.js
Log:
easier to read and corrected regexp for munging iso8601 dates so that they're usable by dojo

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/date.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/date.js	2010-08-10 14:45:21 UTC (rev 17149)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/date.js	2010-08-10 16:16:49 UTC (rev 17150)
@@ -48,7 +48,7 @@
 util.date.db_date2Date = function (db_date) {
     if (typeof window.dojo != 'undefined') {
         dojo.require('dojo.date.stamp');
-        return dojo.date.stamp.fromISOString( db_date.replace( /^(\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d-\d\d)(\d\d)$/, '$1:$2') );
+        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') );
     } else {
         var y  = db_date.substr(0,4); 
         var mo = db_date.substr(5,2); 



More information about the open-ils-commits mailing list