Skip to content

Commit

Permalink
Move the startOfMonth outside the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rgksugan committed Jun 3, 2024
1 parent df9f5d3 commit 79d964a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,10 @@ export function forEachMonth(
end: dayjs.Dayjs,
cb: (current: dayjs.Dayjs) => any
) {
let current = start;
let current = start.startOf("month");
while (current.isSameOrBefore(end, "month")) {
cb(current);
current = current.startOf("month").add(1, "month");
current = current.add(1, "month");
}
}

Expand Down

0 comments on commit 79d964a

Please sign in to comment.