zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

(Feature request) Unix Days as calendar #4061

Open mindey opened 1 year ago

mindey commented 1 year ago

Describe feature

I'm used to managing my diary with unix days (i.e., floor(unix seconds / 86400)) as date instead of Gregorian calendar. I wonder, how could I properly modify the calendar feature without forking the project?

Additional Information

No response

zadam commented 1 year ago

If it's only about the pattern for the note structure naming, then you could simply pre-generate the calendar tree with your desired names (presumably using a script) and attach correct labels (still using YYYY-MM-DD format, e.g. #dateNote=2023-06-21).

mindey commented 1 year ago

Well, I see calendar feature as "Calendar Widget" + "Calendar View" ( "Year folders" ). So, I suppose, to change it, I'd want to:

  1. Write custom calendar widget. Instead of using the calendar widget to select "year" / "month" / "day of month", I'd like to simply enter the unix day (integer), and have a drop-down filter the Unix day, and have calendar note name by day number rather than YYYY-MM-DD.
  2. Change the "Calendar View" queries. Instead of grouping into folders by "Year" and then "Month" (2-levels), I'd like to group into custom time interval folders by "1000 days", "100 days", "10 days" (3-levels).

Auto-attaching labels to existing YYYY-MM-DD may also work, if that would enable me to disable the standard calendar widget, and have Unix day widget, and if the grouping of days could be changed. Also, it would be nice if I could then query in SQL by unix day.

zadam commented 1 year ago

You could create your own Calendar widget as a "launcher widget":

Although I'm not sure if there are some examples of that.

Change the "Calendar View" queries. Instead of grouping into folders by "Year" and then "Month" (2-levels), I'd like to group into custom time interval folders by "1000 days", "100 days", "10 days" (3-levels).

That should be possible by that pre-generating approach. Trilium doesn't care in which structure the day notes exist, they just need to have a correct #dateNote label.