Created
April 2, 2019 03:35
-
-
Save pinguxx/12c8f2a3e8c8261b0b849744cb379389 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('date', (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()} | |
`; | |
} | |
} | |
return { | |
text: formatted | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment