Last active
February 25, 2020 00:31
-
-
Save tjwebb/c231e74cfde3213c93f5d1a21f8c53c6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 tooEarlyDate (horrible, sad) { | |
let lessHorrible = horrible.toLocaleTimeString(); | |
let lessSad = new Date(sad).valueOf(); | |
let offset = horrible.getTimezoneOffset(); | |
//let [ no, stillno, nope, junk, newMoreGoodTime ] = new Date((offset * 60 * 1000) + lessSad).toISOString() | |
let newMoreGoodTime = new Date(lessSad).toISOString().replace(/^.+T/, '').replace(/\.0.+/, ''); | |
return `at ${lessHorrible} steve said ${newMoreGoodTime} is too early to wake up`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment