NUKnightLab / NUKnightLab/TimelineJS3
Cosmological date formatting is wrong
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.2k
- Forks
- 645
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked TimelineJS example and reproduce the formatting for cosmological dates, especially the year 321 entry. Trace the date-formatting logic used by the timeline and verify that years such as 321 are not displayed as “321 years ago”; the existing Display date workaround provides a comparison for the corrected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100