This is a migrated thread and some comments may be shown as answers.

Format a De-serialized date

1 Answer 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gaetano
Top achievements
Rank 1
Gaetano asked on 22 Jan 2013, 04:28 PM
Hi Guys, 
I'm having some trouble trying to parse a deserialized date for a template...

my date after being deserialized seems like: /Date(1309471200000+0200)/
if I use that kind of date as a member of a kendo grid (using { type: "date" } and template: '#= kendo.toString(myDate,"dd/MM/yyyy") #') everything works great...

now I defined (inside a script tag in an .ashx page) a template for a listView object, and it is something like:

......
......
<div>
        <span>${kendo.toString(myDate, "dd/MM/yyyy")}</span>
        <span>${kendo.toString(MyNumber, "c02")}</span>
    </div>

......


myNumber gets correctly formatted...
while myDate remains like /Date(1309471200000+0200)/
I've already tried kendo.format("{0:d}, myDate") with no result, and the culture is correctly set to italian.


Thanks in advance!
Fabio



1 Answer, 1 is accepted

Sort by
0
Gaetano
Top achievements
Rank 1
answered on 23 Jan 2013, 09:44 AM
ok, i figured it out by myself...

I passed to the listView a datasource with explicit field type like in the datagri.
that way the toString() works!


thanks
Tags
General Discussions
Asked by
Gaetano
Top achievements
Rank 1
Answers by
Gaetano
Top achievements
Rank 1
Share this question
or