Created
November 24, 2018 18:20
-
-
Save pinguxx/be1854a0c370b2029a28847cc6df2218 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
hyper.define('dateTime', (date) => { | |
let formatted = '', | |
newdate = date; | |
if (date) { | |
if (typeof newdate.getMonth !== 'function') { | |
newdate = new Date(date); | |
} | |
if (typeof newdate.getMonth === 'function') { | |
formatted = ` | |
${newdate.getMonth() + 1}/${newdate.getDate()}/${newdate.getFullYear()} ${newdate.getHours()}:${newdate.getMinutes()}:${newdate.getSeconds()} | |
`; | |
} | |
} | |
return { | |
text: formatted | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment