Hi everyone, I decided to have a play around with Craft X and made an “Insert Date” plugin. It shows a calendar in the extension sidebar and lets you insert the selected date. This date is linked to the daily note for that day. It’s how the /date command works but has more options than just today, tomorrow, yesterday.
Note that it doesn’t really work on the web. Yes, it inserts a date, but it doesn’t link properly. This is a bug/ not yet implemented feature in Craft Web and the issue also exists with the official /date commands.
Just installed it aswell!
Same here: it makes it way easier to insert a date-badge
i support @shryn here: insert the date at the cursor would be (actually way more) useful for me aswell.
just a design thing: the colors in the head of the “insert date”-Extensions doesn’t suit well into to rest of the shades of grey design of craft.
actually this is generally interesting. i also got an issue with the blue X. maybe pick one of the four colors of the craft icon?! however, this is your extension and so your choice. it was just my humble opinion if this is fine for you! if you need support (some concrete proposals), let me know.
Thanks everyone for checking it out. It was definitely me just having a play around with the API. I agree completely about inserting the date at the cursor rather than adding a new block. I’ll see if I can figure out how to do it.
Also, the calendar itself, I used a web-component, and it was the first one that I found that worked. This also meant I wasn’t really able to amend the colours due to not being able to reach into the shadow DOM. I was hoping to use the browser default month picker but unfortunately the webview inside Craft doesn’t have any browser replacements for inputs. (Sorry if that got a bit techy).
Now that I know it’s of use to others I’ll spend some time rewriting it - probably in React so I have access to a bigger range of calendars. I’ve also got a few other ideas.
v1.1.0 Minor update available - the date is now inserted in a new block after the current cursor position. If there is no block selected it’ll be added to the end of the document. Not quite what was desired but a step in the right direction.
Cursor position isn’t available, only the current block, so it can’t be inserted where the cursor is. I’m thinking to develop it further I could copy the current block content, add the date at the end, and put the block back (using updateBlocks).
The current insert date behaviour is “click on the date you want”, followed by a click on the “Insert date” button. Would it be better if clicking on the date inserted the date - therefore removing a step?
this was exactly what I came here looking for!
I was wondering if its possible to get it to where it will auto-fill over on the calendar side
the content that the date was added to in a Daily Note?
or does it already do that and I haven’t figured that out yet?
thank you for making this! this is sooo useful!
It won’t copy the text that you create in a normal into the daily note - if that’s what you mean - but on the daily note there will be a link back to the normal note under the Links to this page section.
That’s all part of the default Craft functionality - this plugin just allows you to insert a date beyond what Craft has let you do via the slash menu.