Skip to content

Instantly share code, notes, and snippets.

@jonpemby
Created March 5, 2018 19:00
Show Gist options
  • Save jonpemby/f000be057a5f509d55e0f1d36f1e002c to your computer and use it in GitHub Desktop.
Save jonpemby/f000be057a5f509d55e0f1d36f1e002c to your computer and use it in GitHub Desktop.
Format a JavaScript date for HTML5 "date" input value
document.querySelector('.datepicker').value = (new Date()).toISOString().substr(0, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment