okfn / timeliner

[DEPRECATED] See new TimeMapper repo https://github.com/okfn/timemapper
https://github.com/okfn/timemapper
93 stars 21 forks source link

Better Date format support (+ Guide) #20

Closed keyboardkat closed 10 years ago

keyboardkat commented 11 years ago

Quick note that with the template (which is great so far BTW) would be useful to specify what date format you want - and perhaps have a quick guide for those who need a bit more help getting set up.

keyboardkat commented 11 years ago

Note @rgrp I'm still having a big problem with this - can't figure out what date format is necessary. Each time I try to put this spreadsheet https://docs.google.com/spreadsheet/ccc?key=0AgKCQJHmtLY_dHh5V3E0M3I5UkhMTzZqcDBYV3dnYUE#gid=0 into the Timeliner for the Open Book timeline, it tells me date is invalid for each cell. Any thoughts on what's incorrect?

rufuspollock commented 11 years ago

Hi, i've updated indicating that yyyy-mm-dd is best format. Note that you can get gdocs to show that format either by changing format for that column in the menu or by putting a ' in front of the date e.g.

'2013-01-09
keyboardkat commented 11 years ago

@rgrp thanks again for your help - fixed date formats and now it looks great! -> http://timeliner.okfnlabs.org/?backend=gdocs&url=https://docs.google.com/spreadsheet/ccc?key=0AgKCQJHmtLY_dHh5V3E0M3I5UkhMTzZqcDBYV3dnYUE%23gid=0#explorer

rufuspollock commented 11 years ago

@djw this is one item i think we really have to revisit (and fix). What do you think?

rufuspollock commented 11 years ago

also stop alerting on bad parse ... (maybe have a little notify bar at the top)

Example: use this spreadsheet https://docs.google.com/a/okfn.org/spreadsheet/ccc?key=0AqR8dXc6Ji4JdGROdFQ4S1JTTGFYX0twTFBhOHhhZFE#gid=0

djw commented 11 years ago

screen shot 2013-05-16 at 13 13 49

djw commented 11 years ago

Re. the original problem, I think the solution is to switch from the list-based feed to the cell-based feed. It contains an unambiguous numerical version of the date:

"gs$cell": {
    "$t": "2/1/2013 12:01:00", 
    "col": "3", 
    "numericValue": "41306.50069444445", 
    "row": "3"
}

The value appears to be days since 1st Jan 1900.

Examples:

https://spreadsheets.google.com/feeds/list/0AoLbyso0G25hdHBPaVNIbFFjYk1FVHZRQUs3VzltREE/od6/public/values?alt=json https://spreadsheets.google.com/feeds/cells/0AoLbyso0G25hdHBPaVNIbFFjYk1FVHZRQUs3VzltREE/od6/public/values?alt=json

The list-based feed only gives dates as strings, and they're formatted according to the locale of the spreadsheet (which the API doesn't seem to tell you).

rufuspollock commented 11 years ago

@djw given the difficulties here what I suggest is we add an option on the create page (and into the query string on the view page) to designate whether we are US or non-US locale and use that to prompt the date parse (or perhaps just do parsing by hand ourselves??)

wdyt? What would be the name of this option and would be its values?

rufuspollock commented 10 years ago

WONTFIX. https://github.com/okfn/timemapper now fixes this by allowing you to explicitly select day first or month first setup.