Homepage    |    Wiki    |    GitHub    |    Twitter

Plugin: Slash Commands - Datetime & More

The last essential plugin for my workflow which I rush a little bit to be in time for new year resolution. There are still a lot of plugins in my backlogs but they all nice-to-have features so I will not develop any of them soon.

Slash Commands is a collection of utility commands that can be executed by typing corresponding keywords, which start with a slash ('/'). Current version only supports two type of commands (string and datetime) but more might be added in the future.


You can define your own commands but it can be tricky so please check github README. This plugin will be a great companion with my other plugin for task management:


Updated v1.1.0

Added Calendar Command that print an ascii calendar. It is quite a niche utility so not sure if anyone else beside me want one.

      December 2021       
Su  Mo  Tu  We  Th  Fr  Sa
             1   2   3   4
 5   6   7   8   9  10  11
12  13  14  15  16  17  18
19  20  21  22  23  24  25
26  27  28  29  30  31

If you already edit the plugin setting the update will not able to add the new command by itself so you have to manually add calendar command to your setup

["calendar", "calendar", [null,"en-US","ja-JP"] ]

Or you can check github page and copy the default command definitions.

You can print calendar of the current month or any specified month by typing /calendar-m-yyyy


Thanks for this and all your other plugins. I'm not sure how I would use this, but it looks like it could be handy.

1 Like

This is awesome, but basing the beginning of the week on the locale has always been bullshit. I am not saying this is your fault, I'm just saying this is a gerneral problem. e.g. I am in Canada and according to the locale info the week starts on Sunday. Well, this might be, but I start work on Monday and work until Friday, so my week starts on Monday.
Whoever came up with Sunday as the start of the week must have been related to the idiots who thought that miles and Fahrenheit are great and useful units.

The only time it makes sense to use Sunday as the start of the week is in countries in the Middle East.

Long story short, it should not be based on the locale but on a parameter.

I see. I did saw some debate about that but a week starts in Sunday or Monday never actually bothers me that much, and I use several different locales across devices, so I just go with whatever that requires the less effort from me.

The current locale parameter is actually used to translate the month and weekdays to the respectable language. I will consider that as a configurable parameter for future update but as this is quite a niche utility it's priority will not be very high.

Don't worry about it. It was rather meant as a general comment.

I would certainly appreciate a parameter for setting the beginning of the week, but I do understand that the priority for that is low. All good. Great plugin.

PS: Btw, as an idea (also not important). How about using // for getting a list of all commands in the command palette (and then use autocomplete search)? Not sure how useful that is though...

Updated v1.2.0

Add support for Datetime Command Weekday Query so you can get date of a specific day of week by add a keyword to your command. For example

/date@mon        # Next Monday (exclude today)
-> 17/01/2022
/date@mon-1      # Last Monday (or today)
-> 10/01/2022

Supported keywords are: @1 or @sun for Sunday, @2 or @mon for Monday, @3 or @tue for Tuesday, @4 or @wed for Wednesday, @5 or @thu for Thursday, @6 or @fri for Friday, @7 or @sat for Saturday.

Just update the plugin and all datetime commands will support this feature.

1 Like