X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..refs/heads/old:/docs/source/JSON.html diff --git a/docs/source/JSON.html b/docs/source/JSON.html index 471eff5b..d21157e9 100644 --- a/docs/source/JSON.html +++ b/docs/source/JSON.html @@ -1,12 +1,18 @@ - -
- -/** + + + ++ \ No newline at end of fileThe source code + + + + +/*! + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license + */ +/** * @class Ext.util.JSON * Modified version of Douglas Crockford"s json.js that doesn"t * mess with the Object prototype @@ -30,7 +36,7 @@ Ext.util.JSON = new (function(){ return n < 10 ? "0" + n : n; }, doDecode = function(json){ - return eval("(" + json + ')'); + return eval("(" + json + ")"); }, doEncode = function(o){ if(!Ext.isDefined(o) || o === null){ @@ -118,6 +124,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:
+ * @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) + "-" + @@ -178,6 +196,6 @@ Ext.encode = Ext.util.JSON.encode; * @method decode */ Ext.decode = Ext.util.JSON.decode; -+Ext.util.JSON.encodeDate = function(d) { + return d.format('"Y-m-d"'); +}; +