JSONReturnBinder is using the default Date encoding from JSON.Net (see
http://james.newtonking.com/archive/2009/02/20/good-date-times-with-json-net.aspx
)
It would be cool if JSONReturnBinder accepted an enum or something to
change this behavior and use JavaScriptDateTimeConverter instead...
maybe you could implement it and send a patch? ;-)

Rationale for this encoding: 
http://weblogs.asp.net/bleroy/archive/2008/01/18/dates-and-json.aspx

On Jun 20, 7:06 pm, Gabriel Mancini de Campos
<[email protected]> wrote:
> Hi Again Guys,
>
> Sorry my flood but i had a trouble, with jquery integration...
> In my View i have some like this:
>
>  $('#btnList').click(function() {
>
>             ajaxOption = $.extend(ajaxOption, {
>                 url: 'MyAction.mvc',
>                 sucess: function(return) {
>                     $('#txtDate').val(return.Date); <---- set datetime
> value to a text field
>                 },
>                 type: "Get"
>             });
>
>             $.ajaxSetup(ajaxOption);
>             $.ajax();
>         });
>
> my Action like this:
>
> [AccessibleThrough(Verb.Post)]
> [Rescue(typeof(RescueController), "JsonError")]
> [return: JSONReturnBinder]
> public Customer MyAction() {
>    return repository.FindAll()[0];
>
> }
>
> and the return Json like this:
>
> [{"Campanha":"3","Canal":{"Descricao":"Loja","Id":1},"Data":"\/Date
> (1245531858000-0300)\/" ,"Numero":"123412","NumeroParcelas":
> 5,"PlanoFinanciamento":{"Descricao":"Plano 1","Id":1},"Produto":
> {"Descricao":"Mastercard","Id":1}]
>
> "Data":"\/Date(1245531858000-0300)\/" <------------- WTF!!!
>
> any one knows how i show the true date????
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to