Created
August 3, 2024 19:35
-
-
Save radiocity/a90716c77a81abfee0ee7a96c70e06cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (startDate, endDate) => { | |
const result = []; | |
const currentDate = startDate; | |
while (currentDate <= endDate) { | |
const day = currentDate.getDay(); | |
if (day !== 0 && day !== 6) { | |
result[result.length] = new Date(currentDate.getTime()); | |
} | |
currentDate.setDate(currentDate.getDate() + 1); | |
} | |
return result; | |
}; |
Author
radiocity
commented
Aug 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment