Get the first date in the month of a date
JavaScript
const getFirstDate = (d = new Date()) => new Date(d.getFullYear(), d.getMonth(), 1)
TypeScript
const getFirstDate = (d = new Date()): Date => new Date(d.getFullYear(), d.getMonth(), 1)
const getFirstDate = (d = new Date()) => new Date(d.getFullYear(), d.getMonth(), 1)
const getFirstDate = (d = new Date()): Date => new Date(d.getFullYear(), d.getMonth(), 1)