Update isWeekday.md
We should probably make this and the isWeekend snippet have the same description...
This commit is contained in:
@ -3,11 +3,11 @@
|
||||
Results in a boolean representation of a specific date.
|
||||
|
||||
Pass the specific date object firstly.
|
||||
Use `Date.getDay()` to check weekday then return a boolean.
|
||||
Use `Date.getDay()` to check weekday by using a modulo operator as then returning a boolean.
|
||||
|
||||
```js
|
||||
const isWeekday = (t = new Date()) => {
|
||||
return t.getDay() >= 1 && t.getDay() <= 5;
|
||||
return t.getDay() % 6 !== 0;
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user