diff --git a/.peppa/memory/pep-304.md b/.peppa/memory/pep-304.md new file mode 100644 index 00000000..08a40330 --- /dev/null +++ b/.peppa/memory/pep-304.md @@ -0,0 +1,4 @@ +# Память: PEP-304 + +## Соглашения +- Время людям (PEP-304) — только `platformTime`/`platformDayTime`/`platformZone` из `@peppa/shared/time`; `toLocale*String` для дат без `timeZone` не писать. Лимит в `claudePrint` — `limited`/`limitedUntil`, не «нет подписки». diff --git a/apps/web/app/(app)/errors/[id]/page.tsx b/apps/web/app/(app)/errors/[id]/page.tsx index f9e50f84..070cdbc5 100644 --- a/apps/web/app/(app)/errors/[id]/page.tsx +++ b/apps/web/app/(app)/errors/[id]/page.tsx @@ -1,6 +1,7 @@ // PEP-218: the card of one production error, read from Bugsink on the server. The superadmin // opens any error, a project's owner or member — errors of that project only (else 404). // «Инженер» and the superadmin see the stack, tags, events and the link to Bugsink. +import { platformZone } from "@peppa/shared/time"; import Link from "@/components/Link"; import { notFound } from "next/navigation"; import { Bug, ExternalLink } from "lucide-react"; @@ -46,8 +47,8 @@ export default async function ErrorPage({ params, searchParams }: { params: Prom {t.n(r.events, "{n} раз", "{n} раза", "{n} раз")} {d.users != null ? {t.n(d.users, "у {n} пользователя", "у {n} пользователей", "у {n} пользователей")} : null} - {t("впервые {ago}", { ago: ago(r.firstSeen, t) })} - {t("последний раз {ago}", { ago: ago(r.lastSeen, t) })} + {t("впервые {ago}", { ago: ago(r.firstSeen, t) })} + {t("последний раз {ago}", { ago: ago(r.lastSeen, t) })}
{r.taskKey ? ( @@ -109,7 +110,7 @@ export default async function ErrorPage({ params, searchParams }: { params: Prom
); @@ -125,4 +126,4 @@ export function OutageLine({ m, t, now = new Date() }: { m: MonitorView; t: Tran return {parts.join(" · ")}; } -const hhmm = (iso: string) => new Date(iso).toLocaleTimeString("ru-RU", { hour: "2-digit", minute: "2-digit", timeZone: process.env.PEPPA_TZ || undefined }); +const hhmm = (iso: string) => new Date(iso).toLocaleTimeString("ru-RU", { hour: "2-digit", minute: "2-digit", timeZone: platformZone() }); diff --git a/apps/web/components/PlatformDelays.tsx b/apps/web/components/PlatformDelays.tsx index 7235aef8..3c0697cc 100644 --- a/apps/web/components/PlatformDelays.tsx +++ b/apps/web/components/PlatformDelays.tsx @@ -1,3 +1,4 @@ +import { platformZone } from "@peppa/shared/time"; import Link from "@/components/Link"; import { DELAY_REASON_NAMES, type DelayView } from "@peppa/core"; import { delayActionForm } from "@/app/(app)/dashboard/actions"; @@ -13,7 +14,7 @@ import { getT } from "@/lib/i18n"; */ export async function PlatformDelays({ delays, actions = false }: { delays: DelayView[]; actions?: boolean }) { const t = await getT(); - const hhmm = (ms: number) => new Date(ms).toLocaleString("ru-RU", { day: "2-digit", month: "2-digit", hour: "2-digit", minute: "2-digit", timeZone: process.env.PEPPA_TZ || undefined }); + const hhmm = (ms: number) => new Date(ms).toLocaleString("ru-RU", { day: "2-digit", month: "2-digit", hour: "2-digit", minute: "2-digit", timeZone: platformZone() }); return (