X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/f5240829880f87e0cf581c6a296e436fdef0ef80..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/docs/source/Date.html diff --git a/docs/source/Date.html b/docs/source/Date.html index e4169f8c..672d5693 100644 --- a/docs/source/Date.html +++ b/docs/source/Date.html @@ -7,10 +7,10 @@
/*! - * Ext JS Library 3.3.0 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ /** * @class Date @@ -673,9 +673,12 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null calc = [], regex = [], special = false, - ch = ""; + ch = "", + i = 0, + obj, + last; - for (var i = 0; i < format.length; ++i) { + for (; i < format.length; ++i) { ch = format.charAt(i); if (!special && ch == "\\") { special = true; @@ -683,14 +686,22 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null special = false; regex.push(String.escape(ch)); } else { - var obj = $f(ch, currentGroup); + obj = $f(ch, currentGroup); currentGroup += obj.g; regex.push(obj.s); if (obj.g && obj.c) { - calc.push(obj.c); + if (obj.calcLast) { + last = obj.c; + } else { + calc.push(obj.c); + } } } } + + if (last) { + calc.push(last); + } Date.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", 'i'); Date.parseFunctions[format] = new Function("input", "strict", xf(code, regexNum, calc.join(''))); @@ -802,19 +813,17 @@ dt = Date.parseDate("2006-02-29 03:20:01", "Y-m-d H:i:s", true); // returns null + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n", // 2-digit year s:"(\\d{1,2})" }, - /** + /** * In the am/pm parsing routines, we allow both upper and lower case * even though it doesn't exactly match the spec. It gives much more flexibility * in being able to specify case insensitive regexes. */ - a: { - g:1, - c:"if (/(am)/i.test(results[{0}])) {\n" - + "if (!h || h == 12) { h = 0; }\n" - + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}", - s:"(am|pm|AM|PM)" + a: function(){ + return $f("A"); }, A: { + // We need to calculate the hour before we apply AM/PM when parsing + calcLast: true, g:1, c:"if (/(am)/i.test(results[{0}])) {\n" + "if (!h || h == 12) { h = 0; }\n"