Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ describe("IgxCalendar - ", () => {
const firstRowItem = row.nativeElement.children[0];
if (idx === 5) {
expect(firstRowItem.firstChild.innerText).toEqual(
"12",
"13",
);
}
});
Expand All @@ -638,7 +638,7 @@ describe("IgxCalendar - ", () => {
const firstRowItem = row.nativeElement.children[0];
if (idx === 5) {
expect(firstRowItem.firstChild.innerText).toEqual(
"43",
"44",
);
}
});
Expand Down
6 changes: 3 additions & 3 deletions projects/igniteui-angular/core/src/date-common/util/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ export class CalendarDay {
return prevYearDec31.calculateSimpleWeekNumber(weekStart);
}

const daysSinceFirstWeek = Math.floor((this.timestamp - firstWeekStart.timestamp) / millisecondsInDay);
const daysSinceFirstWeek = Math.round((this.timestamp - firstWeekStart.timestamp) / millisecondsInDay);
return Math.floor(daysSinceFirstWeek / 7) + 1;
} else {
const daysSinceYearStart = Math.floor((this.timestamp - yearStart.timestamp) / millisecondsInDay);
const daysSinceYearStart = Math.round((this.timestamp - yearStart.timestamp) / millisecondsInDay);
return Math.floor(daysSinceYearStart / 7) + 1;
}
}
Expand Down Expand Up @@ -201,7 +201,7 @@ export class CalendarDay {
* Calculates the number of weeks between two Thursday dates (ISO 8601 helper).
*/
private getWeeksDifference(currentThursday: CalendarDay, firstWeekThursday: CalendarDay): number {
const daysDifference = Math.floor((currentThursday.timestamp - firstWeekThursday.timestamp) / millisecondsInDay);
const daysDifference = Math.round((currentThursday.timestamp - firstWeekThursday.timestamp) / millisecondsInDay);
return Math.floor(daysDifference / 7);
}

Expand Down
Loading