PDA

View Full Version : DataField dateFormat



INeedADip
22 Apr 2009, 11:53 AM
What about adding a new "dateFormat" for something like "msdate" that could format dates using Microsoft's format?


case "date":
cv = function(v){
if(!v){
return '';
}
if(Ext.isDate(v)){
return v;
}
if(dateFormat){
if(dateFormat == "timestamp"){
return new Date(v*1000);
}
if(dateFormat == "time"){
return new Date(parseInt(v, 10));
}
if(dateFormat == "msdate"){
return new Date(parseFloat(v.slice(6, 19)));
}
return Date.parseDate(v, dateFormat);
}
var parsed = Date.parse(v);
return parsed ? new Date(parsed) : null;
};
break;

Would save me a bunch of code....