GitHub 6219★

Check if a date is a weekday

JavaScript version

// `date` is a Date object
const isWeekday = (date = new Date()) => date.getDay() % 6 !== 0;

TypeScript version

const isWeekday = (date = new Date()): boolean => date.getDay() % 6 !== 0;
Follow me on and to get more useful contents.