faithbooklive / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

Going further back than about 100k years in time - for evolutionary timelines, etc. #439

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Try entering dates more than 1000 years in the distant past for any variable 
that accepts a year value. 

What is the expected output? What do you see instead?

Expected: timeline works arbitrarily far into the past.

Actual: 

1. The ajax data-time regex doesn't recognise years that aren't 4 characters 
long. This causes dates like '-70000' (i.e. 70kya) to be parsed as '-7000' 
(i.e. 7kya. This was easily fixed by changing the start of the regex definition 
in SimileAjax.DateTime._dateRegexp from '"^(-?)([0-9]{4})("' to 
'"^(-?)([0-9]*)("'

I think this more general definition is unilaterally better and should be used.

2. Even so (and with custom million year time increments defined as per the 
very helpful wiki instructions) this fails because the javascript UTC date 
functions all return NAN when year number get larger than about abs(100k). 
Since the whole api seems to be written around these methods, I didn't bother 
trying to fix it. Instead I just used 1 year increments and tweaked labeller.js 
so that it prints kya (i.e. 1000 years ago) and mya (i.e 1 million years ago) 
after each entry. This is fine for me since 1k years is the minimum increment I 
care about, but may not suffice for others.

Incomplete example of my cludgey solution here: 

http://coevolution.psych.ubc.ca/content/timeline/

I see no reason that timelines should be limitted to the present and suspect 
that others may want to use this cool application for timelines that have both 
very old events (e.g. billions of years ago) AND discriminate fine increments 
in the present. I think the only way to solve this is to move away from 
date.getUTCDate() and other such functions.

Original issue reported on code.google.com by monkeyMa...@gmail.com on 2 Jun 2011 at 3:39

GoogleCodeExporter commented 8 years ago

Original comment by ryan...@csail.mit.edu on 23 Jun 2011 at 10:18

GoogleCodeExporter commented 8 years ago

Original comment by ryan...@csail.mit.edu on 23 Jun 2011 at 10:34