improvement: rtl direction, solar calendar and persian formatting added for persian users.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { LabCaseDetail } from '@/types/cases';
|
||||
import type { CaseToothChartProsthesisRow } from '@/components/ui/lab/CaseToothChartPanel';
|
||||
import { formatAppDateTime } from '@/lib/i18n/format';
|
||||
|
||||
export function formatPatientName(patient: { firstName: string; lastName: string }) {
|
||||
return `${patient.firstName} ${patient.lastName}`.trim();
|
||||
@@ -7,10 +8,7 @@ export function formatPatientName(patient: { firstName: string; lastName: string
|
||||
|
||||
export function formatCaseDateTime(value: string | null, locale: string) {
|
||||
if (!value) return '—';
|
||||
return new Intl.DateTimeFormat(locale, {
|
||||
dateStyle: 'medium',
|
||||
timeStyle: 'short',
|
||||
}).format(new Date(value));
|
||||
return formatAppDateTime(value, locale, { dateStyle: 'medium', timeStyle: 'short' });
|
||||
}
|
||||
|
||||
export function buildCaseProsthesisRows(labCase: LabCaseDetail): CaseToothChartProsthesisRow[] {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { BadgeVariant } from '@/components/ui/shared/Badge';
|
||||
import { formatAppDate, APP_DATE } from '@/lib/i18n/format';
|
||||
|
||||
export function toDateInputValue(iso: string | null | undefined): string {
|
||||
if (!iso) return '';
|
||||
@@ -18,13 +19,7 @@ export function formatLabCaseDueDate(
|
||||
locale: string,
|
||||
): string | null {
|
||||
if (!iso) return null;
|
||||
const date = new Date(iso);
|
||||
if (Number.isNaN(date.getTime())) return null;
|
||||
return new Intl.DateTimeFormat(locale, {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
}).format(date);
|
||||
return formatAppDate(iso, locale, APP_DATE.short);
|
||||
}
|
||||
|
||||
/** Whole calendar days from today (UTC) until due date. Negative = overdue. */
|
||||
|
||||
Reference in New Issue
Block a user