mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-01 10:53:11 +00:00
Dispatchers can flag Aveta on Service and Notes and filter those rows without a site-level attribute.
16 lines
672 B
TypeScript
16 lines
672 B
TypeScript
import { fmtDate } from "@/domain/work-orders/utils/wizard-date-utils";
|
|
|
|
export function formatRescheduleCountLabel(count: number): string {
|
|
return count === 1 ? "1 time" : `${count} times`;
|
|
}
|
|
|
|
/** Hover copy for the Reschedule pill (count ≥ 2). Uses originalDate when the API sends it. */
|
|
export function formatRescheduleHover(count: number, originalDate?: string): string {
|
|
const times = formatRescheduleCountLabel(count);
|
|
const base = `Rescheduled ${times} — this WO has had its date changed ${times}.`;
|
|
const formatted = originalDate ? fmtDate(originalDate) : "";
|
|
if (!formatted) {
|
|
return base;
|
|
}
|
|
return `${base} Original date: ${formatted}.`;
|
|
}
|