Skip to content

Commit

Permalink
avoid friday if its in the period but not last day
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperordrup committed Jan 24, 2025
1 parent 790af13 commit 0dd695b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Empty file added js
Empty file.
7 changes: 5 additions & 2 deletions weekdays.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,18 @@ <h3>Friday</h3>
let n = 0;
let t = 0;
while (td <= endDate) {
if (isWeekday(td)) {
const isFridayButNotLastDay = currentDate.getDay() === 5 && currentDate < endDate;
if (isWeekday(td) && !isFridayButNotLastDay) {
t++;
}
td.setDate(td.getDate() + 1);
}
let currentDate = new Date(startDate);
// Loop through the date range
while (currentDate <= endDate) {
if (isWeekday(currentDate)) {

const isFridayButNotLastDay = currentDate.getDay() === 5 && currentDate < endDate;
if (isWeekday(currentDate) && !isFridayButNotLastDay) {
calendarEntries.push({
type: entry.type,
name: entry.name,
Expand Down

0 comments on commit 0dd695b

Please sign in to comment.