You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Be able to specify exact dates as well as relative dates #108
Currently, the code in src/helpers/datetime.ts allows for setting deltas relative to some date, but that date can only be today's date ({{date}}) or two beginning of the week options({{bowm}}/{{bows}}).
It would be nice to be able to specifically set some values in the datetime, rather than have to rely on relative changes, eg if I'm making a diary for the month, with daily headers, and want to find the first day of the month, I need to use something like this:
To create a whole month of diary entries automatically (it finds the number of days by setting today's date, setting it to the first of the month, adding a month to get to next month, and then rolling back a day to find the last day of the current month)
I'm aware, but as far as I can tell those only work if you want to set the day, month and year all at the same time, but there's no option for setting them individually.
Eg, if I want to set the 7th day of the current month, but leave the month and year unchanged, something like {{ datetime set_date="07/??/???? }} doesn't work.
I have an idea of how to solve this btw (the issue was more just as a matter of recording the gap), I'm just very busy for the next couple of days, but when I'm free on Monday I'll try to implement it and open a PR then 👌
I have an idea of how to solve this btw (the issue was more just as a matter of recording the gap), I'm just very busy for the next couple of days, but when I'm free on Monday I'll try to implement it and open a PR then 👌
Let's brainstorm on this before you work on this. I don't think exposing set_month, etc. is needed. I can think of some better user-friendly options.
Activity
nishantwrp commentedon Mar 21, 2025
Hi @ImperialSquid, there is a
set_dateandset_timeexposed already;plugin-templates/src/helpers/datetime.ts
Line 6 in 08bdfaa
Did you mean something else?
ImperialSquid commentedon Mar 21, 2025
I'm aware, but as far as I can tell those only work if you want to set the day, month and year all at the same time, but there's no option for setting them individually.
Eg, if I want to set the 7th day of the current month, but leave the month and year unchanged, something like
{{ datetime set_date="07/??/???? }}doesn't work.You have to set all of them, or none of them.
ImperialSquid commentedon Mar 21, 2025
I have an idea of how to solve this btw (the issue was more just as a matter of recording the gap), I'm just very busy for the next couple of days, but when I'm free on Monday I'll try to implement it and open a PR then 👌
nishantwrp commentedon Mar 22, 2025
Let's brainstorm on this before you work on this. I don't think exposing
set_month, etc. is needed. I can think of some better user-friendly options.