iTranslated by AI
I Created a VS Code Extension to Insert Dates Using Keywords like 'tomorrow' or 'next monday'
Have you ever wanted to quickly insert a date in VS Code?
I have. Today's date is fine, but I often use things like "tomorrow," "next Monday," "next Friday," "N days later," and "the first day of next month."
I looked for VS Code extensions, but couldn't find one that felt right to me.
So, thinking "My niche needs might only be answerable by myself," I created and published my own VS Code extension.
Demo
Here is a demo of the implemented features.
Insert dates like today, tomorrow, or next Monday

Insert date N (days/weeks/months/years) later

Usage
Installation
First, install the following extension.
Specifying the Format
You can specify the date format by opening the settings with cmd + , and searching for easyDateInsert.format. (Currently, only predefined formats are supported, and the default value is YYYY-MM-DD.)

Insert dates using specific keywords
On Mac, you can open the command palette with cmd+shift+p and call the following commands to insert a date.

This example shows entering up to tomorrow, but you can also call dates like "next Monday" by typing monday, etc.
- Running the
Easy Date Insert: Todaycommand inserts today's date.- It is likely to appear as a suggestion quickly after typing just
today.
- It is likely to appear as a suggestion quickly after typing just
- Running the
Easy Date Insert: Tomorrowcommand inserts tomorrow's date. - Running the
Easy Date Insert: Next Fridaycommand inserts the next Friday's date. - Running the
Easy Date Insert: Next Mondaycommand inserts the next Monday's date. - Running the
Easy Date Insert: Last of Monthcommand inserts the date of the last day of the current month.
Insert date N (days/weeks/months/years) later

- You can insert a date by running the
Easy Date Insert: Insert Datecommand.- For example, after entering
3and selectingday, you can insert the date for 3 days later. - After entering
2and selectingweek, you can insert the date for 2 weeks later.
- For example, after entering
TIPS: Keybinding Settings
For those who find it tedious to open the command palette with cmd+shift+p every time, you can insert dates more easily by setting keybindings.
For example, the following shows a setup where cmd+shift+D inserts the date for tomorrow. (The format is set to YYYY年MM月DD日.)

{
// example for tommorow command
{
"key": "cmd+shift+d",
"command": "easy-date-insert.tomorrow"
"when": "editorTextFocus"
}
// You can set another command in the same way.
}
Background
I want to be able to write as many documents as possible in the same way on any PC.
Ideally, in a format that can be version-controlled using a familiar editor.
Thanks to GistPad, which I learned about in the blog below, my progress on blog post notes and technical book notes has improved.
- Can enter documents in a familiar editor
- Can enter documents in Markdown format
- Can enter documents with Vim keybindings
- Version control possible with Git
This is sufficient for most documents, but when I try to manage ToDos as well, I frequently need to enter information about "by when" it should be done.

If it were just today's date, I could manage with shortcuts or other extensions, but I wanted to quickly enter dates like "next Monday" or "next Friday," which are often used in ToDos.
So, I created this extension myself.
Summary
- I created my own VS Code extension to satisfy my niche needs.
- Thoughts
- For such a simple feature, I was able to build it in just a few hours.
- However, saving even a single second in daily date entry is quite significant.
- If I can't find a good extension in the future, I'll consider making it myself.
- Future Tasks
- It might be a good idea to allow free-form format input.
- There are some commands I might not use right now, and there are probably more commands I'd want.
- It might be good to have all "Next [Day of the week]" options.
- I'll add convenient commands as I find them through use.
Here is the repository. If you find any bugs or have points for improvement, please feel free to submit an Issue or Pull Request.
References
I referred to the following articles while creating the extension:
Also, I referred to the following article before publishing the extension:
Both were very clear articles with plenty of photos.
Thank you very much.
Discussion