JS Date

Last Updated: September 5, 2021

You can use the moment library to work with date and time

Get the last day of the month

moment().endOf('month').format('D'); // last day of the current month
moment('2021-08-01').endOf('month').format('D');