From 75fbc3268105c3d30dea2bf44ad90a936731308d Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 28 Feb 2012 14:47:14 +0800 Subject: [PATCH] Date.js --- Date.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Date.js b/Date.js index 88904904f4..1eabc5b011 100644 --- 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:[ -- 2.39.2