seanlowe/obsidian-timelines

[bug - horizontal] negative dates ranges render, positives dates ranges dont (for a historical timeline)

Closed this issue · 3 comments

As stated, ranges with negative dates (BC to BC) render fine.
However, strictly positive ranges (AD to AD) dont, while the timeline renders fine,
and mixed (BC to AD) seem to break timeline render altogether.

So here is my example file:
https://github.com/Liam-Craft/screenshots/blob/main/test%20ceram.md

To me everything seems to be correctly formatted, so maybe something is so obvious I can't see it !


Also as a quick aside question, looking through debug messages to resolve this, one of the buildHorizontalTimeline | there is an endDate for event object is for exemple:

normalizedAndCleanedDateObject: {
    "cleanedDateString": "-50-0-0-0",
    "year": -50,
    "month": -1,
    "day": 0,
    "hour": 0,
    "normalizedDate": "-00050-00000-00000-00000"
}

is it normal for month to change to -1 instead of 0 given the original date ? (I'm not familiar at all with date-string magic....)

OK it took me some time but I was able to track this down.

Due to differences in the way I need to handle negative dates versus positive dates that are sub 1900, passing in DAY/HOUR values that are 0 end up breaking the timeline. I just deleted the 00-00 from the start/end date on your broken event and it rendered as expected.

I'm pushing a release with some updated logging / error messages so that this issue will be more apparent in the logs in the future.

Thanks for creating the issue. If you have any other problems, don't hesitate to create new issues.

I'm late to respond, but Thank you.

Since I followed the formatting to the letter, I wouldn't have stumbled upon this solution !

I'll keep an eye open when tinkering with timelines :)

Take a good look through the docs, or the video I made. Those are both good resources for getting started with this plugin.

Thanks for creating the issue!