Greetings.

I'm generating JSON which looks like this:

% curl 
'http://localhost:8088/podcasting/track/testseries/counting;json;interval'
{"events": [{"id": "r1", "url": "/podcasting/event/r1", "title": "counting", 
"description": "The set Z forms a group under addition; Z+ does not.", "tags": 
[{"tag": "testseries-counting", "url": "/podcasting/tag/testseries-counting", 
"owner": "Administrator", "aut_owner_p": false}], "comments": [], "start": 
"2010-06-21T11:32:00+03:00", "end": "2010-06-21T11:32:21+03:00", 
"durationEvent": true, "aut_recordingUrl": 
"/podcasting/track/testseries/counting", "aut_owner_p": false, "aut_audioUrl": 
"/podcasting/audio/r1", "aut_isrecording_p": true}], "dateTimeFormat": 
"iso8601"}

(that's mostly intended for consumption by Timeline, but with other material 
for other AJAX clients)

I'm expecting this to be parsed by Timeline, because it seems to match the 
description on 
<https://code.google.com/p/simile-widgets/wiki/Timeline_EventSources>, and the 
profile of ISO-8601 suggested by 
<http://dojotoolkit.org/api/jsdoc/dojo/1.2/dojo.date.stamp.fromISOString>.  
However I'm getting a Javascript error:

TypeError: Object 2010-06-21T11:32:00+03:00 has no method 'getTime' "XmlHttp: 
Error handling onReadyStateChange" (simile-ajax-bundle.js:1541)

(that's from Chrome/Webkit, I get similar error messages from Safari/Webkit and 
from Firefox/Gecko).  All I can take from this is that it appears that this 
time specification isn't being parsed successfully, but I've nothing to go on 
beyond that.

The Timeline_EventSources page specifies (in section 
<https://code.google.com/p/simile-widgets/wiki/Timeline_EventSources#JSON_Data_Format>)
 that the JSON time-format attribute is 'date-time-format', but the examples 
and the code suggest that it's actually 'dateTimeFormat', as above.  So that 
should be OK.

But this explanation -- that Timeline isn't parsing my dates -- doesn't seem 
completely plausible.

When I evaluate 
SimileAjax.DateTime.parseIso8601DateTime("2010-06-21T11:32:00+03:00") I get a 
correct date, and when I evaluate 
SimileAjax.NativeDateUnit.getParser("iso8601") I get a function which parses 
this string correctly.

Am I calling this correctly?  I do:

    Timeline.loadJSON(dataUrl+";interval",
                function(event_info, load_url) {
                    console.log("content: from <" + load_url
                                + "> start=" + event_info.events[0].start
                                + " (" + typeof(event_info.events[0].start)
                                + ") and end=" + event_info.events[0].end);
                    ...

...and I get

content: from </podcasting/track/testseries/counting;json;interval> 
start=2010-06-21T11:32:00+03:00 (string) and end=2010-06-21T11:32:21+03:00 

Looking at Timeline.DefaultEventSource.prototype.loadJSON(), and bearing in 
mind the result of getParser("iso8601") above, this _should_ be working, 
shouldn't it?

This code was working when the server was generating "start": new Date(2010, 
...) (I've changed it because I want this JSON to be standard, so that it work 
with other clients), so it does appear to be something to do with parsing.

So I've ended up at rather at a loss for how to proceed -- any ideas, anyone?

This is Chrome 24.0.1312.52 on OS X, and Timeline 2.3.0.

Best wishes,

Norman


-- 
Norman Gray  :  http://nxg.me.uk

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/simile-widgets?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to