Closed (fixed)
Project:
Views TimelineJS integration
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
23 Jan 2013 at 01:36 UTC
Updated:
12 Aug 2013 at 06:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
barami commentedfix miss typing on above patch.
Comment #2
barami commentedThis must be accepted. Because TimelineJS ISO format seems to not support dates over -9999 ~ 9999 years.
javascript supports a number of 6 ciphers. And i use this module with partial date.
TimelineJS script supports several format. And one is a csv format. It's very useful.
I've tested dates from 271000 BC to 271000 AD with month, day, an other granularity.
(Even datetime display correctly, bottom timeline don't work properly.)
Comment #3
eclecto commentedCSV seems to be the best, if not only correct way to pass dates to the JS plugin; leaving things in ISO format was only correctly displaying the year for me. I suggest converting all time field formats to CSV and adding granularity to the view settings since a full date and time seem to be passed regardless of the original granularity settings of the source field.
Barami's patch needs reworking also, because the contents of plugins/date_sources/date_field.inc have changed.
Comment #4
operinko commentedFluxSauce: Have you had a chance to think about an alternative to the current date/time handling?
What would you think are the pros and cons of switching over to CSV format?
Comment #5
fluxsauce commentedoperinko: I took a job at Pantheon Systems in San Francisco, so I've been a bit busy - haven't thought about it. I'll put aside a few hours this week for this.
At this time, I'm not against CSV. Timeline JS's homepage seems to prefer JSON. I think the two formats can co-exist side-by-side, defaulting on JSON (current default). Thoughts?
Comment #6
barami commentedTimeline Js uses json, jsonp and other formats.
In json format, time values are parsed by built in parser. And csv parser is built in timeline js script.
So, json and csv are not conflict to each other.
http://timeline.verite.co/lib/timeline/data.json This is an example json data.
https://github.com/VeriteCo/StoryJS-Core/blob/master/Core/VMM.Date.js Parsers are implemented in parse function of this file.
Comment #7
spfaffly commentedCongrats on the new job Flux!
barami is correct on this one - I had to create a similar patch earlier this week as the times weren't being displayed properly but thought it was the way I was passing in my dates, but come to find out it's affecting more than just the views I was creating.
Comment #8
xaqroxHere's a new version of barami's patch. It is slightly hacked, since I was running into the same problem as eclecto, I second his comment entirely.
Also, this patch chokes on content where the date field is empty, it ends up creating a date object with no value and that seems to totally break everything. It seems like the date api stuff is just being used to format the date, so maybe we could bypass the whole issue by using PHP built-ins?
Comment #9
operinko commentedJust committed a change to this.
I couldn't use your patch xaqrox, due to misplaced conversion functions.
We only need one conversion function in the .module file, instead of 1 function for each date source.
Also hacked in some form of granularity support (it's checking for non-null values while building the date format string).
A node with no value in the date field should now properly default to 1/1/1970 (Unix Epoch).
Comment #10
operinko commentedComment #11
xaqroxOops, yeah I later realized I left a bunch of junk in that patch anyway, sorry about that. I downloaded the latest dev and all the csv code is working great, including the granularity stuff. Thanks!
I opened a new issue to talk about empty dates: #1959096: Handle empty date values
Comment #12
operinko commented