Last active
November 17, 2017 21:03
-
-
Save AaronBDC/a638578988592904b1b1330f6ed9ff8f 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
calcAge(dateString){ | |
let added_date = moment(new Date(dateString)).fromNow(true); | |
// console.log('today=', today); | |
added_date = added_date.replace(' days',''); | |
added_date>7 ? added_date = moment(dateString).format("dddd, MMMM Do, YYYY") : added_date = moment(new Date(dateString)).fromNow(false); | |
return added_date; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment