Created
February 11, 2023 20:44
-
-
Save SimplGy/2676c4ccad30d9c71f7096422eb5fd44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: today-timestamp | |
// Description: inserts today's date in "ISO" format 2023-02-11 | |
// Snippet: | |
import '@johnlindquist/kit'; | |
function twoDigits(number: number): string { | |
return number.toString().padStart(2, '0'); | |
} | |
await hide(); | |
const today = new Date(); | |
const formatted = `${today.getFullYear()}-${twoDigits(today.getMonth() + 1)}-${twoDigits(today.getDate())}`; | |
await keyboard.type(formatted); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment