Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LK64076007A/52dc7175ed60a98cd5ad to your computer and use it in GitHub Desktop.
Save LK64076007A/52dc7175ed60a98cd5ad to your computer and use it in GitHub Desktop.
This is some JavaScript that prepends the date to each line of some text in Drafts 4 for iOS.
var date = new Date().toISOString().replace(/(\d+-\d+-\d+).+/gm,'$1 ');
draft.content = draft.content.replace(/^/gm,date);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment