Skip to content

Instantly share code, notes, and snippets.

@SimplGy
Created February 11, 2023 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimplGy/2676c4ccad30d9c71f7096422eb5fd44 to your computer and use it in GitHub Desktop.
Save SimplGy/2676c4ccad30d9c71f7096422eb5fd44 to your computer and use it in GitHub Desktop.
// 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