How can I obtain the last day of the month with the timestamp being 11:59:59 PM?
Do not forget month started with 0 so +1 in month too.
let enddayofmonth = new Date(year, month, 0).getDate();