Daily Log по проекту: событие засчитывается менеджеру проекта независимо от автора (багрепорт employee_reports, миграция 028); Resolution
All checks were successful
ci / test (push) Successful in 30s
ci / deploy (push) Successful in 2m31s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 20:12:36 +03:00
parent f1d8809e1d
commit caec489563
7 changed files with 80 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
import { localDate } from "khb_common";
import Fastify, { type FastifyInstance } from "fastify";
import { buildSeries, buildWeeks, datesBetween, markBlackWeeks, rangeStart, weekStartOf, type ActivityDay } from "./activity.js";
import { buildTotals } from "./charts.js";
@@ -17,7 +18,7 @@ export interface EmployeeReportsDeps {
/** Сегодняшняя дата YYYY-MM-DD в часовом поясе. */
export function todayIn(tz: string, now: Date): string {
return new Intl.DateTimeFormat("en-CA", { timeZone: tz, year: "numeric", month: "2-digit", day: "2-digit" }).format(now);
return localDate(now, tz); // luxon: не зависит от локали и версии ICU (en-CA в Node 20 даёт 10/14/2026)
}
const clampDays = (raw: unknown, fallback: number): number => {