seanlowe / obsidian-timelines

Create a timeline view of all notes with the specified combination of tags
https://seanlowe.github.io/obsidian-timelines/
MIT License
39 stars 2 forks source link

BCE Dates #20

Closed Exkywor closed 4 months ago

Exkywor commented 6 months ago

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?

seanlowe commented 6 months ago

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!

Exkywor commented 6 months ago

It seems the issue is not closed xD I'm using the frontmatter to assign the properties, but cannot get dates before year 0 to display.

I'm trying this, but it doesn't show in the timeline image

ReconVirus commented 6 months ago

use the date formate YY-MM-DD-HH so something like -0300-01-01-00

It seems the issue is not closed xD I'm using the frontmatter to assign the properties, but cannot get dates before year 0 to display.

I'm trying this, but it doesn't show in the timeline image

seanlowe commented 6 months ago

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?

Exkywor commented 6 months ago

Thanks, gonna try it in a sec. Right now just the event is missing when I had one with a BCE date.

seanlowe commented 6 months ago

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.

Exkywor commented 6 months ago

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
ReconVirus commented 6 months ago
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
Exkywor commented 6 months ago

All of those render vertically, with no noticeable difference between them.

seanlowe commented 6 months ago

@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!

Exkywor commented 5 months ago

Any updates?

seanlowe commented 5 months ago

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.

vadhmln commented 5 months ago

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.

Exkywor commented 4 months ago

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!

Exkywor commented 4 months ago

I totally missed the first time this was suggested