Hi Jon. I'll try to take a look just as soon as the semester's teaching ends.

------ Original Message ------
From: "Jon Crump" <crum...@plu.edu>
To: "SIMILE Widgets" <simile-widgets@googlegroups.com>
Sent: 11/21/2018 3:28:16 PM
Subject: [Simile-Widgets] Re: Exhibit - Timeline How to display dates before/after 9999 BC/AD

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 <http://neolography.com/staging/itinExhibitSketchIII.html> 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")
SunDec31-1000023:59:02 GMT-0752(PacificStandardTime)

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")
FriDec31-1000123:59:02 GMT-0752(PacificStandardTime)

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

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

    SimileAjax.DateTime._dateRegexp =newRegExp(
        "^(-?)([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")
SunDec31-1000023:59:02 GMT-0752(PacificStandardTime)
SimileAjax.DateTime.parseIso8601DateTime("-10000-01-01")
FriDec31-1000123:59:02 GMT-0752(PacificStandardTime)

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")
TueDec31-100123:59:02 GMT-0752(PacificStandardTime)
SimileAjax.DateTime.parseIso8601DateTime("-10000-01-01")
FriDec31-1000123:59:02 GMT-0752(PacificStandardTime)
SimileAjax.DateTime.parseIso8601DateTime("-9999-01-01")
SunDec31-1000023:59:02 GMT-0752(PacificStandardTime)

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.

On Tuesday, June 10, 2008 at 8:17:31 AM UTC-7, David Huynh wrote:
Date/time is parsed by the code in this file
http://static.simile.mit.edu/ajax/api-2.0/scripts/date-time.js <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


Shhh!!! wrote:
> 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
>
> >
>










--
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-widgets+unsubscr...@googlegroups.com.
To post to this group, send email to simile-widgets@googlegroups.com.
Visit this group at https://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/d/optout.

--
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-widgets+unsubscr...@googlegroups.com.
To post to this group, send email to simile-widgets@googlegroups.com.
Visit this group at https://groups.google.com/group/simile-widgets.
For more options, visit https://groups.google.com/d/optout.

Reply via email to