It's not that I'm picky about the formatting.  I'm just wondering why
it appears (and maybe I'm wrong on this) that when transfer gets a
datetime object from a database, it formats it into a string, rather
than keeping it as a CF datetime.  Yes, CF can interpret the string as
transfer formats it as a date, but they're not really "dates" [which
means JS / JSON doesn't read them as dates].

>From what I can tell, (and again, I may be wrong on this), functions
that are in the decorator don't get "evaluated"/called when using
getMemento(), which means your idea [which I had tried] won't allow me
to use the "quick and easy" serializeJson() function.

So, in any case, it looks like I will have to manually build my json object.

Thanks.

On Wed, Jan 13, 2010 at 7:40 PM, Mark Mandel <[email protected]> wrote:
> If you are really picky about the formatting - overwrite the getXXXDate()
> methods in a decorator, and voila, you're done.
>
> Mark
>
> On Thu, Jan 14, 2010 at 1:33 PM, Scott Brady <[email protected]> wrote:
>>
>> On Wed, Jan 13, 2010 at 7:23 PM, Cody Caughlan <[email protected]> wrote:
>> > Hmm, I think thats normal behavior. It sounds like you're suggesting
>> > that the JSON serializer should encode a Date as
>> >
>> > "{ts '2010-01-13 19:09:09'}"
>>
>> Not quite.  I probably wasn't clear.  The formats I was giving were
>> the formats BEFORE the serialization.
>>
>> When CF serializes the two formats, here are the results
>> {ts '2010-01-13 19:09:09'} -->  January, 13 2010 19:20:48  [a valid JS
>> date format]
>> 2010-01-13 19:09:09 --> 2010-01-13 19:09:09  (not a valid JS date format)
>>
>> Now, if I manually run an inline query for that same object and
>> serialize the query, the date gets formatted correctly.
>>
>> >
>> > Microsoft has a blog post on this here:
>> >
>> > http://weblogs.asp.net/bleroy/archive/2008/01/18/dates-and-json.aspx
>> >
>> > They say: "The second approach, which is what most people settled on,
>> > is to adopt some string form of date and just interpret any string
>> > that conforms to this format as a date."
>> >
>> > Which is what we have done as well.
>> >
>>
>> Their final solution seemed to be exploiting a loophole in JSON
>> itself, which would worry me, since loopholes can be closed. :)
>>
>> Besides, if I have to manually format the object, then I lose the
>> benefit of using serializeJson() and I can just go the query / manual
>> formatting route.
>>
>> Scott
>>
>> --
>> -----------------------------------------
>> Scott Brady
>> http://www.scottbrady.net/
>>
>> --
>> Before posting questions to the group please read:
>>
>> http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
>>
>> You received this message because you are subscribed to the Google Groups
>> "transfer-dev" 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/transfer-dev?hl=en
>
>
>
> --
> E: [email protected]
> T: http://www.twitter.com/neurotic
> W: www.compoundtheory.com
>
>
> --
> Before posting questions to the group please read:
> http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
>
> You received this message because you are subscribed to the Google Groups
> "transfer-dev" 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/transfer-dev?hl=en
>



-- 
-----------------------------------------
Scott Brady
http://www.scottbrady.net/
-- 
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" 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/transfer-dev?hl=en

Reply via email to