X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/src/util/core/JSON.js diff --git a/src/util/core/JSON.js b/src/util/core/JSON.js index 2747e11b..6b1dd334 100644 --- a/src/util/core/JSON.js +++ b/src/util/core/JSON.js @@ -1,6 +1,6 @@ /*! - * Ext JS Library 3.1.0 - * Copyright(c) 2006-2009 Ext JS, LLC + * Ext JS Library 3.1.1 + * Copyright(c) 2006-2010 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license */ @@ -116,6 +116,18 @@ Ext.util.JSON = new (function(){ return a.join(""); }; + /** + *

Encodes a Date. This returns the actual string which is inserted into the JSON string as the literal expression. + * The returned value includes enclosing double quotation marks.

+ *

The default return format is "yyyy-mm-ddThh:mm:ss".

+ *

To override this:


+Ext.util.JSON.encodeDate = function(d) {
+    return d.format('"Y-m-d"');
+};
+
+ * @param {Date} d The Date to encode + * @return {String} The string literal to use in a JSON string. + */ this.encodeDate = function(o){ return '"' + o.getFullYear() + "-" + pad(o.getMonth() + 1) + "-" +