Reputation: 5559
I want to get the start and end dates of a particular year.
Something like moment(2009).startOf('year') // Format: 2009-01-01 00:00 moment(2009).endOf('year') // Format: 2009-12-31 11:59
Upvotes: 0
Views: 41
Reputation: 494
Try something like this:
const start = moment([2009]).startOf('year').format('YYYY-MM-DD HH:MM');
const end = moment([2009]).endOf('year').format('YYYY-MM-DD HH:MM');
Upvotes: 1