Last active
August 29, 2021 15:45
-
-
Save procarrera/38de7783e3ffc156f61bbca4225f9b9d to your computer and use it in GitHub Desktop.
toLocaleDateString en-CA
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
var date = new Date("2021-09-01T03:00:00.000Z"); | |
var options = { weekday: 'long', month: 'long', day: '2-digit', year: "numeric" }; | |
console.log(date.toLocaleDateString('en-CA', options).replace(', ',' - ')); | |
/* OUTPUT */ | |
// Wednesday - September 01, 2021 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment