fix: dashboard
Deploy banu-front / deploy (push) Successful in 1m34s

This commit is contained in:
sajjadtalkhabi
2026-07-12 12:03:26 +03:30
parent dbc166f015
commit b592f520ab
33 changed files with 1714 additions and 102 deletions
+17
View File
@@ -0,0 +1,17 @@
import { toJalaali } from '@/utils/date-utils'
const FA_DIGITS = '۰۱۲۳۴۵۶۷۸۹'
export const toFaDigits = (value) => String(value ?? '').replace(/\d/g, (d) => FA_DIGITS[d])
/**
* Formats an ISO timestamp as a compact Jalaali meta line — "۱۴۰۰/۷/۱۹, ۸:۳۰".
* Reads the wall-clock date/time from the string as-is (no timezone shift), so
* the value mirrors what the backend recorded.
*/
export const formatJalaaliMeta = (iso) => {
const match = String(iso ?? '').match(/^(\d{4})-(\d{2})-(\d{2})[\sT](\d{2}):(\d{2})/)
if (!match) return ''
const { jy, jm, jd } = toJalaali(Number(match[1]), Number(match[2]), Number(match[3]))
return toFaDigits(`${jy}/${jm}/${jd}, ${Number(match[4])}:${match[5]}`)
}