Last active
February 12, 2023 06:22
-
-
Save danielo515/9356f1af0b642dd23f6cdc188d73d7be 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 the today date (not including time) formatted as YYYY/MM/DD | |
// Snippet: !tday | |
import '@johnlindquist/kit'; | |
function twoDigits(number: number): string { | |
return number.toString().padStart(2, '0'); | |
} | |
await hide(); | |
const today = new Date(); | |
// Format date to YYYY/MM/DD format | |
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