Feature Request: Insert Date ONLY button

Hi all,

A feature I use very frequently is the 'Insert Date Time' button on desktop.
Most of the time however, I do not need the 'Time' component of the DateTime.

It would be excellent to have a button to insert just the Date, or potentially even shift clicking the button inserts the date only?

I am happy to implement this request myself and raise a PR.
I'm first interested to know if there is appetite for this, and what the preferred solution is?

Thanks!

5 Likes

Could be done as a plugin - would be much faster in terms of dev time.

3 Likes

Hmm. I never knew I wanted that. Great idea. I never need the time.

1 Like

Hmm, that sounds like a good first step.
Perhaps I start by implementing it as a plugin, and if there is appetite for it, could be consolidated into the base application. It can be a bit of a pain installing plugins for all these sorts of things

1 Like

I've created a plugin for it!

2 Likes

Yay! That's great. Good on ya!

Any chance of a keyboard shortcut? In for a penny, in for a pound I say.

1 Like

Yes, thats a good suggestion. Any preference for the shortcut?

Is it possible to have it be a part of the built in shortcut system so users are able to re-assign it? I think the core time-date feature is ctrl shift t and I've re-assigned it as ctrl t since I wasn't using whatever ctrl t was.

Thanks!

1 Like

To insert today's date we can also use templates.
For example
{{#custom_datetime}}YYYY-MM-DD{{/custom_datetime}}
It's more flexible, we can choose format and also there's a shortcut, CTRL-ALT-i

It would be useful if this plugin allowed to choose other dates as well.

Somehow I totally missed that insert date/time button and am thrilled it can be used in the note title. Thanks for pointing it out. I use dated title notes for a journal and this will save me some time starting entries.

Yes, another vote for the option to enter YYYY-MM-DD or even just YY-MM-DD.

A vote for MMMM d, yyyy?

@skim1124 @duxswhatduxs version 1.0.1 of the plugin takes the date time setting of Joplin.

With templates it is easy to select what do you want.
For example, you can do thinks like:

{{#custom_datetime}}YYYY-MM-DD - dddd{{/custom_datetime}}
{{#custom_datetime}}LLL{{/custom_datetime}}
{{#custom_datetime}}LLLL{{/custom_datetime}}
Week {{#custom_datetime}}W-E{{/custom_datetime}}
<u>{{#custom_datetime}}LLLL{{/custom_datetime}} — (__W{{#custom_datetime}}W{{/custom_datetime}}__)</u>

and get:

2021-02-21 - domenica
21 febbraio 2021 19:27
domenica 21 febbraio 2021 19:27
Week 7-7
<u>domenica 21 febbraio 2021 19:29 — (__W7__)</u>

The format came from moment.js, as said in the Joplin website.

Ah, got it! Thanks.

I took at a look at the note template page, but it's not clear to me how to use custom_datetime or moments.js. What would I have to do if I wanted to quickly insert YYMMDD (e.g. 210225 for Feb 25, 2021) in the editor pane or the title bar?

It's really easy. You have to make a template.

  1. Go to menu "File -> Templates -> Open template directory"
  2. Make a file date.md with this content:
    {{#customdatetime}}YYMMDD{{/customdatetime}}
  3. Go to menu "File -> Template -> refresh templates"
  4. Use the shortcut "CTRL+ALT +i" ("COMMAND +OPTION + i" on Mac) and select the template.
  5. Done

Thanks. I didn't realize it was so easy. But I think I had to edit it to be custom_datetime before I got it to work. Also, I had a hard time saving an .md file (as opposed to .txt file); finally had to use Typora.

And as far as I understand, the use of templates is limited to date/time related items?

Template:

You are wrong :wink:, it is really easy. You can do what I said and it's works.
This is the template you want.
data - Momentjs - YYMMDD.md (46 Bytes)

Moreover, for date/time you can use this sort of template, but you can do any template you want putting the text you want to insert in.
For example I use template for fast inserting style tags in my notes, (see the attached file)stile.md (90 Bytes)
Others example here: GitHub - WinkoErades/Joplin-note-taking-templates: Joplin note taking templates


moment.js:

What you need to know from moment.js is only the string format it accept. See tables under this paragraph: Moment.js | Docs


Edit .md files:

Last thing: edit md file does not require Typora (that also is a good markdown editor). A markdown file is a plain text file. You can edit it with notepad (or any plain text editor like VS Code, Vim, Notepad++, etc etc) and then save with the .md extension (if you save it ad .txt you can simply rename it and change the extension).

Hope this was useful.

I should have been more clear. In the original instructions you gave me, it was {{#customdatetime}}YYMMDD{{/customdatetime}}

But that didn't work for me until I put in an underscore between custom and datetime: {{#custom_datetime}}YYMMDD{{/custom_datetime}}

Anyway, I appreciate all your expert help because I like to use YYMMDD universally to identify the date.