A small group of TextExpander snippets that can be used to quickly and easily insert any date in the next week into a document, by referencing it by name. For example, to insert the date of the next Friday after the current date, simply type ;nfri.
The following shortcuts are included:
| Date | Shortcut | |---|---|---| | Next Monday | ;nmon | | Next Tuesday | ;ntues | | Next Wednesday | ;nwed | | Next Thursday | ;nthurs | | Next Friday | ;nfri | | Next Saturday | ;nsat | | Next Sunday | ;nsun |
To install these snippets:
- Open TextExpander
- Click the + sign in the bottom left of the dialog and select Add Group from URL... (or press ⌘ - L)
- Paste in the following URL: https://raw.githubusercontent.com/davidwaterston/textexpander-dates-nextday/master/dates-nextday.textexpander
- Press OK
After a few seconds a new group named Dates: Next Day will appear; your new snippets are ready to use!
By default dates are displayed using the format full day, full month, dd, for example Monday, July 13. If you prefer a different date format you can change this simply by editing the snippet. Each snippet will look like this:
%snippet:util.+getNextDayOfWeek+%%A, %B %e
The first part - %snippet:util.+getNextDayOfWeek+% - should never be changed. The second part - %A, %B %e - is the date formatting and can be modified to suit your requirements. For example:
%snippet:util.+getNextDayOfWeek+%%m/%d/%y
will return the date in mm/dd/yy format, for example 07/17/15. More information about the extensive date formatting options can be found on the TextExpander website.
In the Dates: Next Day group is an oddly named snippet called util.+getNextDayOfWeek+. This is a small snippet of Javascript used to calculate the date of the next whatever day you want. It's used by all of the other snippets in the group and shouldn't be deleted. The unusual name is simply so that it's unlikely you would type it by mistake, causing TextExpander to try and replace the text.
These snippets have been tested and confirmed to work with TextExpander version 5.01 and later. As they make use of the new ability to write snippets in Javascript, it's unlikely they will work in earlier versions.
See the change log file for more details.
I use Semantic Versioning to number releases. Each release is tagged with the appropriate version number and signed using Gnu Privacy Guard (GPG). The public key used to sign releases is
Name: David Waterston
Email: [email protected]
Key ID: A7AD9C85
Signature: 71A9 DC13 447A 1E4F C6EB 5D64 DE08 A991 A7AD 9C85
This public key is included in the repository with a SHA1 of 16d013451476fa4a1a67d6ad4b90583e205b53b1. After cloning the repo, and assuming you have GPG installed correctly, you can import this key into your keychain
git cat-file blob pubkey | gpg --import
When this public key is successfully imported, you can use it to verify the integrity of any of the tagged releases of this repo
git tag -v v1.0.0
which should produce output similar to:
object 04f37a55784c1f3abc2cf927a935a488aa954035
type commit
tag v1.0.0
tagger David Waterston <[email protected]> 1427387056 +0000
Initial commit
This is just an example so don't get fixated on the details, what matters is the signature!
gpg: Signature made Thu 26 Mar 16:24:16 2015 GMT using RSA key ID A7AD9C85
gpg: Good signature from "David Waterston <[email protected]>" [ultimate]
The important thing to notice here is that the RSA key ID matches mine (A7AD9C85) and the line that says that this is a good signature.
The public key can further be verified by checking the details held on pgp.mit.edu.
Copyright (c) 2015 David Waterston. All rights reserved. Distributed under an MIT license. See the LICENSE file for more details.