From 4633605dc6d822690e8fb3accfb05ad768f25662 Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Fri, 19 Jul 2019 15:47:09 -0700 Subject: [PATCH 1/2] Update isWeekday.md We should probably make this and the isWeekend snippet have the same description... --- snippets/isWeekday.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/isWeekday.md b/snippets/isWeekday.md index bb2d3138f..572ce8b8f 100644 --- a/snippets/isWeekday.md +++ b/snippets/isWeekday.md @@ -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; }; ``` From 5033e1b471613859d5aabc136d814b6b97c088c4 Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Fri, 19 Jul 2019 15:49:03 -0700 Subject: [PATCH 2/2] speeling auto correct is the bane of my existence and my best friend --- snippets/isWeekday.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/isWeekday.md b/snippets/isWeekday.md index 572ce8b8f..8a56323bc 100644 --- a/snippets/isWeekday.md +++ b/snippets/isWeekday.md @@ -3,7 +3,7 @@ Results in a boolean representation of a specific date. Pass the specific date object firstly. -Use `Date.getDay()` to check weekday by using a modulo operator as then returning a boolean. +Use `Date.getDay()` to check weekday by using a modulo operator and then returning a boolean. ```js const isWeekday = (t = new Date()) => {