2026-08-24 15:16:51 -03:00
|
|
|
import { fmtDate } from "@/domain/work-orders/utils/wizard-date-utils";
|
|
|
|
|
|
|
|
|
|
export function formatRescheduleCountLabel(count: number): string {
|
|
|
|
|
return count === 1 ? "1 time" : `${count} times`;
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-05 14:13:52 -03:00
|
|
|
/** Hover copy for the Reschedule pill (count ≥ 1). Uses originalDate when the API sends it. */
|
2026-08-24 15:16:51 -03:00
|
|
|
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}.`;
|
|
|
|
|
}
|