Distinguishing date (years): BC/AD (in visjs timeline and elsewhere)

144 views
Skip to first unread message

Miroslav Kalous

unread,
Jan 26, 2018, 2:55:50 PM1/26/18
to TiddlyWiki
Hi, everyone,

I have encountered a problem when using vis.js timeline plugin (which I love and am indebted to its author). But I guess the problem goes beyond this plugin and concerns date formating more generally.

The timeline plugin works with two types of date formating: TW5 date format and moment.js Parse string+format. I haven't found any info about the support for "after/before christ" years formating in these two formats. Does it mean that neither TW5 nor moment.js Parse work with BC dates? It seems so to me but I want to make sure so that is why am asking here.

Practically, it means that every timeline I make starts with the year 0 or after. It never goes back BC.

Thanks everyone for any tips or workarounds,

Mira

coda coder

unread,
Jan 26, 2018, 3:30:21 PM1/26/18
to TiddlyWiki
This is, at core, a javascript problem.  You may wish to read the following links to decide best how to proceed:

http://dclure.org/logs/parsing-bc-dates-with-javascript/
https://stackoverflow.com/questions/25846123/how-to-format-bc-dates-like-700-01-01


So, there are solutions, but I don't know if that will help you with vis.js.

Coda
Reply all
Reply to author
Forward
0 new messages