Last active
February 25, 2020 00:17
-
-
Save iambriansreed/99683ba339a0653b0bcaa7302e887261 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
function datesToLocalTime(...times){ | |
const [announcementTimeStr, tooEarlyTimeStr] = times | |
.map((date) => date.toLocaleString().split(', ')[1].toLowerCase().replace(/:00/g, '')); | |
return `At ${announcementTimeStr} Steve said that ${tooEarlyTimeStr} is too early.`; | |
} | |
console.log(datesToLocalTime( | |
new Date('2020-03-08T19:47:00.000Z'), | |
new Date('2020-03-08T04:30:00.000Z') | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment