Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding "Complete" label (builtin date expressions) #53

Open
m1xds opened this issue Feb 12, 2024 · 4 comments
Open

Regarding "Complete" label (builtin date expressions) #53

m1xds opened this issue Feb 12, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@m1xds
Copy link

m1xds commented Feb 12, 2024

image
Hi maybeyj:

is that possible that by some method we can make this "complete" update automatically? Now it's like "#complete=5" "#total=100", is that possible that we can make it like "#complete=$daycreated" "#total=timeleft"?

@mabeyj
Copy link
Owner

mabeyj commented Feb 12, 2024

I'm not 100% sure what you're asking. Can you provide more details on how this would work?

Are you asking for Collection Views to have some way of setting certain labels on a note? In this case, do you want it to set #complete to $daycreated (a creation date of something?) and #total to timeleft (the current value of a #timeleft label?)? For it to do this automatically, when would it do this and how would it know what notes need to be updated?

@m1xds
Copy link
Author

m1xds commented Feb 12, 2024

For example, this note:
image
For example, in this note, the tag "#completed" can only be set to a fixed number, and then the following completed progress bar can be displayed in the total cellection view:
image
This "progress bar" function is very very very very nice, but now it can only be manually updated every day, I don't know how to make it automatically update, which makes the usefulness greatly reduced, can you make "completed" and total equal to the value in a note, in this example, I just give an example, such as: "#competed=the days differences between the day of creating note with today".
Thank you for your time!

@mabeyj
Copy link
Owner

mabeyj commented Feb 12, 2024

Makes sense. Currently, this should be possible using Trilium's daily global event. A script could run daily that calculates and updates #completed and #total on each note.

I think it would be feasible to introduce some builtin date expressions like daysSince($dateCreated) and daysBetween($dateCreated,dueDate) that would allow Collection Views to perform these calculations.

If today is 2024-02-12 and a note was created on 2024-02-09, then daysSince($dateCreated) would return 3.
If #dueDate is 2029-02-11, then daysBetween($dateCreated,dueDate) would return 1825.

Then combined with a progress bar #attribute=daysSince($dateCreated),progressBar=daysBetween($dateCreated,dueDate) would show a bar with "3 / 1,825" today, "4 / 1,825" tomorrow, etc.

@mabeyj mabeyj added the enhancement New feature or request label Feb 12, 2024
@mabeyj mabeyj changed the title Regarding "Complete" label Regarding "Complete" label (builtin date expressions) Feb 12, 2024
@m1xds
Copy link
Author

m1xds commented Feb 12, 2024

Again, thank you so much for your time and detailed explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants