Ext.util.JSON.encodeDate = function(o) {
function pad(n) {
return n < 10 ? "0" + n : n;
}
return '"' +
o.getUTCFullYear() + '-' +
pad(o.getUTCMonth() + 1) + '-' +
pad(o.getUTCDate()) + 'T' +
pad(o.getUTCHours()) + ':' +
pad(o.getUTCMinutes()) + ':' +
pad(o.getUTCSeconds()) + 'Z"';
}
This function performs much better and uses methods exposed by JavaScript's Date object instead of custom Ext JS date operations. I'd suggest this function instead of the previous one for both Ext-Core and Ext JS.
No comments:
Post a Comment