Hi.

I had tested mobile devices, and This module don't work on android gingerbread(2.3.7) in samsung galaxy S2. But, examples in official site of timelinejs is works.

It's a android problem. I write workaround for this.
You passes iso date string to timlinejs javascript, Android gingerbread couldn't parse this on javascript.
After changed iso to csv, It works fine on gingerbread.

Comments

barami’s picture

StatusFileSize
new4.59 KB

fix miss typing on above patch.

barami’s picture

This 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.)

eclecto’s picture

CSV 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.

operinko’s picture

Assigned: Unassigned » fluxsauce
Status: Needs review » Needs work

FluxSauce: 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?

fluxsauce’s picture

operinko: 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?

barami’s picture

Timeline 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.

spfaffly’s picture

Congrats 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.

xaqrox’s picture

StatusFileSize
new5.51 KB

Here'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?

operinko’s picture

Just 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).

operinko’s picture

Assigned: fluxsauce » operinko
Status: Needs work » Needs review
xaqrox’s picture

Oops, 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

operinko’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.