Exhibit - Timeline How to display dates before/after 9999 BC/AD

97 views
Skip to first unread message

Shhh!!!

unread,
May 31, 2008, 10:07:59 PM5/31/08
to SIMILE Widgets
Hello Everyone,

I am loading a Google spreadsheet into an Exhibit Timeline and it is
having problems displaying
dates past 9999 BC or AD. BC dates are listed in the spreadsheet as
negative (i.e. -1562), but
it can't once it reaches 10000 even though the timeline shows dates
farther down. Does anyone
have any experience with this problem? Thank you.


bzzzzzzzrp

David Huynh

unread,
Jun 10, 2008, 11:17:31 AM6/10/08
to simile-...@googlegroups.com
Date/time is parsed by the code in this file

http://static.simile.mit.edu/ajax/api-2.0/scripts/date-time.js

There are a few regex in that file that you can override to get support
for 5 digit years.

<script>

SimileAjax.DateTime._dateRegexp = new RegExp(
"^(-?)([0-9]{5})(" + [
"(-?([0-9]{2})(-?([0-9]{2}))?)", // -month-dayOfMonth
"(-?([0-9]{3}))", // -dayOfYear
"(-?W([0-9]{2})(-?([1-7]))?)" // -Wweek-dayOfWeek
].join("|") + ")?$"
);

</script>

David

Jon Crump

unread,
Nov 21, 2018, 3:46:17 PM11/21/18
to SIMILE Widgets
Hi David,

If you're still here maybe you can offer some guidance on this question in the current context.
the timeline on this page will plot at date -9999-01-01, but not a date -10000-01-01 (both are in the spreadsheet that supplies the data)

If I try this in the console:
SimileAjax.DateTime.parseIso8601DateTime("-9999-01-01")
Sun Dec 31 -10000 23:59:02 GMT-0752 (Pacific Standard Time)

I see a valid date, but parsing "-10000-01-1" gives a valid date too, but it's nevertheless not plotted on the timeline:
SimileAjax.DateTime.parseIso8601DateTime("-10000-01-01")
Fri Dec 31 -10001 23:59:02 GMT-0752 (Pacific Standard Time)

I tried overriding the `_dateRegexp` as you suggested by doing this:

jQuery(document).on("registerComponents.exhibit", function(ev){


   
SimileAjax.DateTime._dateRegexp = new RegExp(
       
"^(-?)([0-9]{5})(" + [
           
"(-?([0-9]{2})(-?([0-9]{2}))?)", // -month-dayOfMonth
           
"(-?([0-9]{3}))",                // -dayOfYear
           
"(-?W([0-9]{2})(-?([1-7]))?)"    // -Wweek-dayOfWeek
       
].join("|") + ")?$"
   
);

});

the date regex appears to have been overridden:
SimileAjax.DateTime._dateRegexp
/^(-?)([0-9]{5})((-?([0-9]{2})(-?([0-9]{2}))?)|(-?([0-9]{3}))|(-?W([0-9]{2})(-?([1-7]))?))?$/

But the 5 digit date still isn't plotted on the timeline. but `parseIso8601DateTime` functions as I would expect:
SimileAjax.DateTime.parseIso8601DateTime("-9999-01-01")
null

but:
SimileAjax.DateTime.parseIso8601DateTime("-09999-01-01")
Sun Dec 31 -10000 23:59:02 GMT-0752 (Pacific Standard Time)
SimileAjax.DateTime.parseIso8601DateTime("-10000-01-01")
Fri Dec 31 -10001 23:59:02 GMT-0752 (Pacific Standard Time)

I also tried overriding with this regex:
_dateRegexp:/^(-?)([0-9]{1,6})((-?([0-9]{2})(-?([0-9]{2}))?)|(-?([0-9]{3}))|(-?W([0-9]{2})(-?([1-7]))?))?$/

and that too seemed to work as I would expect such that:
SimileAjax.DateTime.parseIso8601DateTime("-001000-01-01")
Tue Dec 31 -1001 23:59:02 GMT-0752 (Pacific Standard Time)
SimileAjax.DateTime.parseIso8601DateTime("-10000-01-01")
Fri Dec 31 -10001 23:59:02 GMT-0752 (Pacific Standard Time)
SimileAjax.DateTime.parseIso8601DateTime("-9999-01-01")
Sun Dec 31 -10000 23:59:02 GMT-0752 (Pacific Standard Time)

But the timeline resolutely refuses to plot any date before -9999


Can you, or anyone listening, give me some idea of what I'm missing?

best,
Jon

PS The page at http://neolography.com/staging/itinExhibitSketchIII.html is a test bed for solving a different set of problems. Please ignore the naive experiments and talking to myself in the comments.

David Karger

unread,
Nov 29, 2018, 10:19:42 PM11/29/18
to simile-...@googlegroups.com
Hi Jon.  I'll try to take a look just as soon as the semester's teaching ends.
--
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 simile-widget...@googlegroups.com.
To post to this group, send email to simile-...@googlegroups.com.
Visit this group at https://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages