DatePicker means one doesn’t have to type out a date, even a natural one
a lot of people also work visually, which DatePicker solves for neatly
and finally, I tried nldates, but found it somewhat limited because I never know what it’s going to recognize and what it’s not. It doesn’t use AI, so it’s limited to what’s coded in it. “First Friday in December” doesn’t work for example.
Now, one can type - [ ] Buy soap /scheduled, and with only a single keystroke (enter), schedule it for today, or use your favorite keys to visually pick a date, and end up with - [ ] Buy soap [scheduled: 2025-12-28]! So cool.
Thank you so much again @Mr.Red, this is terrific!
the arrow key navigation will also move the cursor on the page, making the insertion inacurate and in other place where the slashcommand was inserted… (h/j/k/l works well)
this wasn’t an issue in my version.
if you change the week to start on Sundays, only the header is changed and everything else stays the same:
Oops on the WEEK_START bug, will fix, probably later today.
The arrow key navigation is not affecting me. Perhaps because it’s doing what you say, but I save and restore the cursor in my latest version? Wouldn’t h/j/k/l also cause the same problem for someone using vim keys in their main editor?
Focus shifting back: hmm, it seemed like a problem for me, perhaps because I was using arrow keys in an earlier version and unwittingly causing focus to go away?
On these two issues, suggestions appreciated, as I know next to nothing about web related things.
Oh wow, this was a nasty bug. WEEK_START did not work only when set to 0. Feel free to critique my code, first time writing Javascript.
// old, did not work:
// const WEEK_START = ]] .. tostring(WEEK_START) .. [[;
// fixed:
// Coerce WEEK_START to a number
const WEEK_START = Number(]] .. tostring(WEEK_START or 0) .. [[) || 0;
Other than this, everything else works at my end @Mr.Red. Feel free to let me know if the arrow keys is still an issue or if not, feel free to merge this code to your repo. Thank you!
Haha i would never do that
I also doesn’t consider myself a pro in JS or in any language to be honest. I mostly use LLM to code, and do some debuging and styling by hand. i understand code when i read it, but i couldnt write it without LLM’s
It’s actually designed to be configurable to any day, and so, it accepts values between 0 and 6 (can’t be a boolean).
The root issue is how the lua->JS injection is done which necessitated the check for 0 alone as a special case. Apparently this is a common pattern. I’ll leave it this way