You are hereBlogs / rahul's blog / Serializing DateTime for client-side Coolite/ExtJs consumption

Serializing DateTime for client-side Coolite/ExtJs consumption


rahul's picture

By rahul - Posted on 17 December 2009

If you are trying to figure out why Coolite/ExtJs is giving an error while loading DateTime you serialized to Json manually (including serialization to json of records which contain Datetime fields), here is the answer.

Well, as far as I have seen, Coolite/ExtJs components (including the store) only accept one serialization format for DateTime fields, that is the sortable date/time pattern that conforms to ISO 8601 pattern.

The custom format string for this pattern in .NET that can be passed to the DateTime ToString() method is:
yyyy-MM-ddTHH:mm:ss

Alternatively, you can also use the standard DateTime format specifier for this format, which is "s" in for the DateTime's ToString() method.

Sortable date/time pattern; conforms to ISO 8601

Great - this is a really simple solution that saved me a fair bit of time. Thanks for posting it.

Post new comment

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.

Recent comments