Extjs: Creating a date object from a AJAX (M$) formatted string?
I have an ExtJS listview with a JsonStore connected to a .NET webservice. One of my columns has the type Date
which I want to populate from a .NET DateTime object.
{
header: 'Date',
dateFormat: 'M$',
type: 'date',
tpl: '{myTime:date("j. M Y, G:i")}',开发者_StackOverflow中文版
dataIndex: 'myTime'
}
My result from the webservice is
/Date(1313669548625)/
I am getting an Invalid date
error and a quick test concurs:
var myTime = '/Date(1313669548625)/';
var dt = new Date(myTime);
How can I serve/parse the DateTime object so that my listview can handle the result?
I have interpreted the ExtJS documentation as ExtJS has extended the builtin Date object with parsing of MS Ajax formatted DateTime objects (M$).
I checked and the way to use it is var dt = new Date(Date(1313669548625)) without the slashes and quotes
精彩评论