fix(blog): تاریخ/زمان مطالعه کارتها در /en انگلیسی شد؛ کرسر فیلدهای تصویر دیگر به آخر متن نمیپرد (مقدار محلی با همگامسازی فوکوسآگاه)
This commit is contained in:
@@ -97,3 +97,11 @@ export function toPublishedISO(value?: string | null): string | null {
|
||||
})
|
||||
return jalali.isValid ? toISODate(jalali) : null
|
||||
}
|
||||
|
||||
/** تاریخ میلادی انگلیسی برای سایت /en — با محافظ مقادیر نامعتبر/خالی */
|
||||
export function formatEnDate(value?: string | null): string {
|
||||
if (!value) return ''
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return ''
|
||||
return new Intl.DateTimeFormat('en-GB', { day: 'numeric', month: 'long', year: 'numeric' }).format(date)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user