JSFiddle - React, Tailwind, and code Playground

Getting last day of month using date (always correct day)

by Yurii Predborskyi

JavaScript

let d = new Date(2017,2-1,1,12);
let lastDay = new Date(d.getFullYear(), d.getMonth()+1, 0);
console.log(lastDay);