X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/docs/source/JSON.html diff --git a/docs/source/JSON.html b/docs/source/JSON.html index af4fdd27..d21157e9 100644 --- a/docs/source/JSON.html +++ b/docs/source/JSON.html @@ -1,15 +1,16 @@ + The source code
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * 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 Ext.util.JSON @@ -35,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){ @@ -123,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:


+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) + "-" + @@ -183,6 +196,6 @@ Ext.encode = Ext.util.JSON.encode; * @method decode */ Ext.decode = Ext.util.JSON.decode; -
+ \ No newline at end of file