how to get current year only in moment library in javascript code example Example: moment to javascript date let now = moment() let now = now.toDate()