This package provides some useful functions to deal with dates especially related to leap years.
import { isLeapYear, getDaysInMonth, getDaysInYear } from "year-helper";
console.log(isLeapYear(2000)); // true
console.log(getDaysInMonth(2000, 2)); // 29
console.log(getDaysInYear(2000)); // 366