export function startOfMonth(date: Date) { return new Date(date.getFullYear(), date.getMonth(), 1); } export function endOfMonth(date: Date) { return new Date(date.getFullYear(), date.getMonth() + 1, 0); } export function daysInMilliseconds(days: number) { return 1000 * 60 * 60 * 24 * days; } export function startOfDay(date: Date) { return new Date(date.getFullYear(), date.getMonth(), date.getDate()); } export function daysInMonth(date: Date) { return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(); }