NUKnightLab / TimelineJS3

TimelineJS v3: A Storytelling Timeline built in JavaScript. http://timeline.knightlab.com
Mozilla Public License 2.0
2.99k stars 621 forks source link

Cosmological date formatting is wrong #701

Open JoeGermuska opened 3 years ago

JoeGermuska commented 3 years ago

As pointed out by a Zendesk user, when TimelineJS is using "cosmological" dates (that is, when any year in a timeline is < -271820 or > 275759), the formatting for dates is off.

This timeline (based on this Google Sheet configuration ) demonstrates the issue. The second dated slide has the year "321" but is presented as "321 years ago".

It should, instead, be shown as either "1700 years ago" or, perhaps simply "321 CE". We've wrestled with how to handle very distant dates and relatively recent dates in the same timeline, but in any case, this is a straight out bug since the year 321 is not "321 years ago"

As a workaround, until this is solved, users should take advantage of the "Display date" column, which allows an override of Timeline's algorithm for formatting a date. Remember that "display date" is optional, and should be blank if not needed, but also, all events in a timeline that are not type 'title' must have at least a year, whether or not there is data in the "Display date" column.

jottevanger commented 3 years ago

Thanks for the workaround @JoeGermuska. Our timelines are in part generated so subscribing to notifications for when there is a fuller solution!

JoeGermuska commented 2 years ago

This has languished, since not many people use cosmological date timelines, or if they do, they haven't made noise about this problem.

It's further aggravated by the fact that all of the format strings assume times in the past. There's no formatting possible for future dates, as we've written it.

My hunch is that for dates inside 10,000 years ago, we should switch to simply displaying the date more like the normal case. In fact, it would be best to actually use TLDate objects so as to take advantage of any localization (typically to do with rendering BCE/BC and CE/AD) although perhaps in some cases people would prefer to be consistent with the "years ago" style (although in that case, we're not actually accounting for the extra 2000+ years since CE year 1, so it's mucked up in all kinds of ways, honestly.)