seanlowe / obsidian-timelines

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

[Feature] add support for minutes and seconds in timeline dates #77

Open widarr opened 1 month ago

widarr commented 1 month ago

Hi! I created a few events and tested them in the timeline - they were loaded as normal, but as soon as I added the 4th one nothing is loaded not even the window of the timeline code block...

the events look like this one:


title: Classical Antiquity description: The age of the first human empires and city states color: "#A5FF76" type: background startDate: -3000-01-01 endDate: 0476-01-01 era: O.E. path: "" tags:

... and the timeline looks like this:

tags=timeline;events;eras
divHeight=800
type=flat

Tested it also on another computer... When I start Obsidian my events are there in the timeline, but as soon as I click on another note and then again on the one containing the timeline it vanishes again... Does timelines(revamped) have a problem with events that span over thousands of years?

seanlowe commented 1 month ago

hey there, a couple questions:

Quick debugging check, as well: in the Timelines Revamped plugin settings, all the way at the bottom there's a "Debug Mode". Turn that on. Then push Ctrl + Shift + I to open the dev console. try rendering the timeline and see if any red errors show up.

Screenshots if anything looks out of place are helpful.

Hopefully we can get this figured out for you pretty quick

widarr commented 1 month ago

Its in different files. the error occurs with html and frontmatter events. tested it with files in one directory and over multiple directories.

I think I have closed in to the error. Here is a really simple vault where I created 4 background events. the first three worked like normal but as soon as I added the 4th one (Atomic Age) where I changed the date Format from YYYY-MM-DD to YYYY-MM-DDThh:mm:ss it stoped to work... it seems ob-timeline can't handle mixed format events. Dumb_Vault.zip

edit: It also worked again when I changed all events to this format: 2003-01-01-1-0-0

edit2: it still doesn't work properly if I enter some more realistic time frames. Then the window works, but only the last event is rendered events_not_rendered

edit3: in my experiments if have further found that timeline doesn't accept dates before 1901, every event (visible when set to point) that timeline doesn't recognise is automatically set to the Unix epoch (01.01.1970) This applies to events as well as to the minDate and startDate flags. The upper end of the scale works though... i can easily set the timeline to end in the year 30000

edit4: It even breaks the timeline if an event with a pre 1901 date purely exists, even if you remove all tags from this event to "comment it out".

seanlowe commented 1 month ago

Hi, the dates are a really finicky part of the timeline, especially the horizontal one. The library used to generate the horizontal timeline casts all dates to a real date time object in javascript so I had to run some wonky logic in order to get it to work properly. But that means that it is very strict about how dates have to be formatted.

You can see in the docs for date arguments, that dates are required to be in the YYYY-MM-DD-HH format

widarr commented 1 month ago

(Just tested it with the YYYY-MM-DD-HH format - this also doesn't work.) edit: ok this DOES work (I oversaw one event that still had the wrong format)... but yeah this is really finicky and actually I WOULD like to have more precision than just hours. Maybe this is an upstream problem with the JavaScript vis timeline?

I tested with various time formats, most of them worked as long as I stayed above year 1901

seanlowe commented 1 month ago

yeah, the code for this is somewhat atrocious haha. Unfortunately yeah, we are constrained by the upstream. There might be some updates I can make, but I'll have to do some more research and testing on my end. How far down were you wanting to specify?

widarr commented 1 month ago

I have ranges of millenia and events down to seconds (but they are nice to have, minutes would suffice). There is a program that could do that: https://thetimelineproj.sourceforge.net/ but I don't want to use 2 programs in parallel anymore, it would be nice if I could do everything with Obsidian.

weirdwizardthomas commented 5 days ago

Bump up for increasing granularity of timestamps!

Flexo013 commented 11 hours ago

Another bump! Making a timeline of events throughout a single day is currently not really feasible, so minutes (and maybe even seconds) would be awesome to have!