Editing of the project's Kariz page

This commit is contained in:
2026-09-15 19:13:30 +03:30
parent 44f9849d0e
commit e61fad95c6
25 changed files with 1751 additions and 567 deletions
+10
View File
@@ -144,6 +144,16 @@ export function formatClock(d: Date | string | null | undefined) {
return `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;
}
export function parseAmount(raw?: string): number | null {
const text = toAsciiDigits(raw ?? '')
.replace(/[,،]/g, '')
.replace(/\s+/g, '')
.trim();
if (!text) return null;
const n = Number(text.replace(/[^\d.-]/g, ''));
return Number.isFinite(n) ? n : null;
}
export function parseJalaliDateTime(dateRaw?: string, timeRaw?: string): Date | null {
const dateText = toAsciiDigits(dateRaw ?? '').trim();
if (!dateText) return null;