Opravy dle SonarLint - klient

This commit is contained in:
2026-01-13 15:35:00 +01:00
parent e03ba45415
commit c264f9921e
11 changed files with 55 additions and 80 deletions

View File

@@ -75,14 +75,14 @@ export const getDayOfWeekIndex = (date: Date) => {
/** Vrátí první pracovní den v týdnu předaného data. */
export function getFirstWorkDayOfWeek(date: Date) {
const firstDay = new Date(date.getTime());
const firstDay = new Date(date);
firstDay.setDate(date.getDate() - getDayOfWeekIndex(date));
return firstDay;
}
/** Vrátí poslední pracovní den v týdnu předaného data. */
export function getLastWorkDayOfWeek(date: Date) {
const lastDay = new Date(date.getTime());
const lastDay = new Date(date);
lastDay.setDate(date.getDate() + (4 - getDayOfWeekIndex(date)));
return lastDay;
}