BCE Dates
Closed this issue · 15 comments
So, today I was adding some history events to my timeline, and I'm seeing that the start-date
property does not allow for dates before the year 0. Is there anything I'm missing here?
I was just about to respond and ask for more information. I'm guessing you figured it out? Would you mind putting the information here for posterity?
Thanks!
The latest pushes I made enables you to put basically anything you want as your date string. If all you know about the date is the year (-300), then you can put that and the plugin internally sorts it all out for you, so that shouldn't be an issue. I'm more wondering what the timeline codeblock looks like when you try to render it. Does it display a timeline but there are no events, or just this particular event is missing?
Thanks, gonna try it in a sec.
Right now just the event is missing when I had one with a BCE date.
Could you paste in the contents of the codeblock you are using to render your timeline?
Another trick I use is to try rendering a vertical timeline (static or not) because there's no timeframe involved in those. If the vertical doesn't render the event, then we have a larger issue.
I tried a vertical one, and it does show events with negative dates, so the issue is only with the horizontal one.
tags=history
startDate=-3000
endDate=2100
divHeight=500
minDate=-3000
maxDate=2100
type=flat
type=flat
Note: Acceptable values for data-type are:
background, best used for time periods
box
point, which is exactly what it sounds like, and
range
All of those render vertically, with no noticeable difference between them.
@ReconVirus Note that I recently added a type=flat
key that only exists on the timeline codeblock, so this is correct. The background
, box
, point
and range
type values all go on the events (HTML / Frontmatter).
@Exkywor I'll look into this and get back to you soon!
Any updates?
Hey @Exkywor, still looking into this. For now, this is a limitation of the library (vis-timeline) I use to generate the horizontal timeline. I've made a few changes locally that allows the time range inside the timeline to be negative but no progress yet on getting the events to render. Part of that is due to the way we need to parse negative inputs into a real date and Moment (shipped with Obsidian) isn't great at it.
I'm looking into alternatives for both rendering the timeline as well as DateTime libraries that might have more functionality.
use the date formate YY-MM-DD-HH so something like -0300-01-01-00
yes, to render dates with negative values you should make startDate: -0300-01-01-00 whith hours, otherwise it doesn't render.
use the date formate YY-MM-DD-HH so something like -0300-01-01-00
yes, to render dates with negative values you should make startDate: -0300-01-01-00 whith hours, otherwise it doesn't render.
Holy cow, the solution was right there all along! This actually fixes it!
I totally missed the first time this was suggested