Skip to content

Commit

Permalink
bugfix exact date
Browse files Browse the repository at this point in the history
  • Loading branch information
baravak committed Dec 27, 2024
1 parent d532ed7 commit 712abab
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export function getMonthDays({
firstDayOfWeek = 1,
consistentWeeks,
}: GetMonthDaysInput): Date[][] {
const day = dayjs(month);
const start = day.subtract(day.date() - 1, 'day');
const day = dayjs(month).subtract(dayjs(month).date() - 1, 'day');
const start = dayjs(day.format('YYYY-M-D'));
const startOfMonth = start.toDate();
const endOfMonth = start.add(+day.daysInMonth() - 1, 'day').toDate();
const endOfMonth = start.add(+start.daysInMonth() - 1, 'day').toDate();
const endDate = getEndOfWeek(endOfMonth, firstDayOfWeek);
const date = getStartOfWeek(startOfMonth, firstDayOfWeek);
const weeks: Date[][] = [];
Expand Down

0 comments on commit 712abab

Please sign in to comment.