Just override Time#to_json in your app.
class Time
def to_json(*)
"\/Date(#{to_i})\/"
end
end
Seems like a pretty crazy format though.
-- Yehuda
2009/3/2 j23tom <[email protected]>
>
> Hello,
>
> I come from the .NET world, so sorry if question is a bit silly (i've
> been experimenting with
> ruby and Merb for about two weeks )
>
> I'm trying to serialize/deserialize objects and send between Merb and
> Silverlight.
>
> I see that Merb default DateTime serialization format is e.g.
> 2009-03-02T13:18:25+01:00
> and .Net (Silverlight) json serializer's default format is "\/Date
> (1198908717056)\/" where
> 1198908717056 is a number of milliseconds since January 1st 1970 UTC.
>
> Since I can't change silverlight's serializer behaviour my question
> is:
> Is it possible to change Merb serializer to use .NET DateTime
> serialization format ?
>
> regards,
>
> Tomasz Kubacki
>
> PS: Here is explanation why they (MS) use this format i mentioned
> above:
> http://weblogs.asp.net/bleroy/archive/2008/01/18/dates-and-json.aspx
>
> >
>
--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---