Date.js
authorAlan Knowles <alan@akbkhome.com>
Tue, 28 Feb 2012 06:47:14 +0000 (14:47 +0800)
committerAlan Knowles <alan@akbkhome.com>
Tue, 28 Feb 2012 06:47:14 +0000 (14:47 +0800)
Date.js

diff --git a/Date.js b/Date.js
index 8890490..1eabc5b 100644 (file)
--- a/Date.js
+++ b/Date.js
@@ -48,6 +48,7 @@ Format  Output      Description
   i      05         Minutes with leading zeros
   s      01         Seconds, with leading zeros
   O      -0600      Difference to Greenwich time (GMT) in hours
+  o      -06        Difference to Greenwich time (GMT) in hours without minutes.. (postgresql outputs this.)
   P      -06:00     Difference to Greenwich time (GMT) with colon between hours and minutes
   T      CST        Timezone setting of the machine running the code
   Z      -21600     Timezone offset in seconds (negative if west of UTC, positive if east)
@@ -428,7 +429,9 @@ Date.formatCodeToRegex = function(character, currentGroup) {
                 "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n", // -12hrs <= GMT offset <= 14hrs
                 "    (sn + String.leftPad(hr, 2, 0) + String.leftPad(mn, 2, 0)) : null;\n"
             ].join(""),
-            s:"([+\-]\\d{4})"};
+            s:"([+\-]\\d{2,4})"};
+    
+    
     case "P":
        return {g:1,
                c:[