Get the first day of the current year using Moment.js Get the first day of the current year using Moment.js jquery jquery

Get the first day of the current year using Moment.js


You could do this:

moment().startOf('year');

format by doing something like this:

moment().startOf('year').format('MM/DD/YYYY');


To get the start date and end date of any given year. You can pass a year as a parameter to moment.

startDateOfTheYear = moment([year]);endDateOfTheYear = moment([year]).endOf('year');


var defaultStart = '01/01/'+new Date().getFullYear()