Skip to content

Poop Code

  • Home
  • Linux

Check if a date is a weekday in TypeScript

November 5, 2024 by poopcode
const isWeekday = (d: Date): boolean => d.getDay() % 6 !== 0;

isWeekday(new Date(2022, 2, 10)); // -> true
isWeekday(new Date(2021, 5, 8)); // -> false

Categories Typescript Tags typescript
MongoError: pool is draining, new operations prohibited – How to fix?
Python code snippet – How to align text in tkinter?
© 2025 Poop Code • Built with GeneratePress