Tuesday, May 8, 2012

convert date from json format to other formats in sencha

Can anyone tell me how to convert date from Json data to normal date format in sencha.



var df = this.dateFormat;

if (!v) {
return v;
}
if (Ext.isDate(v)) {
return v;
}
if (df) {
if (df == 'timestamp') {
return new Date(v * 1000);
}
if (df == 'time') {
return new Date(parseInt(v, 10));
}
return Date.parseDate(v, df);
}
var parsed = Date.parse(v);
return parsed ? new Date(parsed) : null;


Thanks in advance





No comments:

Post a Comment