ui phase 9
This commit is contained in:
@@ -32,3 +32,12 @@ export function formatShamsiDateTime(iso: string | Date, locale: string = 'fa'):
|
||||
minute: '2-digit',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Month + year only (Shamsi for `fa`, Gregorian for `en`), e.g. «تیر ۱۴۰۳» — doubles as a stable
|
||||
* group key for a month-grouped timeline (two timestamps in the same calendar month always format
|
||||
* to the same string), so callers can group directly on this without separate Jalali arithmetic.
|
||||
*/
|
||||
export function formatShamsiMonthYear(iso: string | Date, locale: string = 'fa'): string {
|
||||
return formatShamsiDate(iso, locale, { year: 'numeric', month: 'long' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user