I have the following Data Source in my page:
The date is passed to the Data Source in this format '2009-12-31T00:00:00'.
But when I bind to a grid or dropdownlist, the format is a weird 'Thu Dec 31 00:00:00 PST 2009'. Strangely enough, creating a template and using kendo.toString(EOM, "d") does produce '12/31/2009'. If I bind a dropdownlist to the Data Source the selected value is returned in the weird format, even if I define a valuetemplate.
I need the to date to be in some valid format and I'm not sure how to fix it.
Edit:
Ok after further testing I found that the strange formatting only occurs with IE. But I'm still trying to figure out why the value is returned in that format, rather than in the format I specifiy in the valuetemplate.
var
dsAll =
new
kendo.data.DataSource({
serverFiltering:
true
,
transport: {
read: {
type:
'POST'
,
url:
'/pages/ajax/page.ashx'
,
dataType:
'json'
,
data: {
action:
'model'
,
modelname:
function
() {
return
$(
'#txtModelName'
).val()
}
},
cache:
false
}
},
schema: {
data:
function
(response) {
if
(response == undefined) {
$(
'#spanDateRange'
).hide();
$(
'#gridTrend'
).hide();
}
else
{
console.log(
'DataSource "dsAll" Bound'
);
$(
'#spanDateRange'
).show();
$(
'#gridTrend'
).show();
return
response;
}
},
model: {
fields: {
TrendModelId: { type:
'number'
},
EOM: { type:
'date'
},
Seg: { type:
'string'
},
LostPriceQty: { type:
'number'
},
LostPriceRev: { type:
'number'
},
LostAvailQty: { type:
'number'
},
LostAvailRev: { type:
'number'
}
}
}
}
});
But when I bind to a grid or dropdownlist, the format is a weird 'Thu Dec 31 00:00:00 PST 2009'. Strangely enough, creating a template and using kendo.toString(EOM, "d") does produce '12/31/2009'. If I bind a dropdownlist to the Data Source the selected value is returned in the weird format, even if I define a valuetemplate.
I need the to date to be in some valid format and I'm not sure how to fix it.
Edit:
Ok after further testing I found that the strange formatting only occurs with IE. But I'm still trying to figure out why the value is returned in that format, rather than in the format I specifiy in the valuetemplate.