isWeekend
Modified on Tue, 22 Aug 2023
Description
Use this function to check if a given date falls on a weekend (Saturday or Sunday). It returns true if the date is a Saturday or Sunday, and false if it is any other day of the week.
Syntax
isWeekend(date)
Returns
Return Value | Description |
---|---|
True/False | Returns true if the given date falls on a weekend (Saturday or Sunday), otherwise false. |
Sample
Example | Result | Description |
---|---|---|
isWeekend(2023-08-13) | true | August 13th, 2023, is a Saturday, so the function returns true. |
isWeekend(2023-08-14) | true | August 14th, 2023, is a Sunday, so the function returns true. |
isWeekend(2023-08-09) | false | August 9th, 2023, is a Wednesday, so the function returns false. |
To view all the Date functions, click here.
See Also
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article