GitHub 6219★

Get the first date in the month of a date

JavaScript version

const getFirstDate = (d = new Date()) => new Date(d.getFullYear(), d.getMonth(), 1);

TypeScript version

const getFirstDate = (d = new Date()): Date => new Date(d.getFullYear(), d.getMonth(), 1);
Follow me on and to get more useful contents.