JAVA dates in Timeline

44 views
Skip to first unread message

tsti...@hoboweb.com

unread,
Apr 13, 2017, 8:05:01 PM4/13/17
to Google Visualization API
New to Group - Hello All

I am struggling with Google timelines. Specifically the JAVA error around two digit years prior to 1900 (like 79AD)
Also struggling with dates BCE.
I am not strong with JAVAscript. I know there is some script that can force a "Full Date" Can anyone show how the sample code on the Google Timeline would be modified to deal with these date ranges?
So that one could build (for example) a biblical timeline with many dates in the -100bce - 100AD time frame.

Thanks Tim

jlcope

unread,
Feb 10, 2018, 11:45:10 PM2/10/18
to Google Visualization API
I am able to handle BCE dates in the following way:

        dataTable.addRows([
          ['Socrates', new Date(-470,0,1), new Date(-399,0,1)],
          ['Plato', new Date(-428,0,1), new Date(-348,0,1)],
          ['Aristotle', new Date(-384,0,1), new Date(-322,0,1)],
          ['Euclid', new Date(-325,0,1), new Date(-270,0,1)]
        ])

However, I get errors when I attempt to add a row that spans the BCE/CE divide.
Reply all
Reply to author
Forward
0 new messages