From 5f021b5ff34f17111b5f60f0f201335e96e86528 Mon Sep 17 00:00:00 2001 From: G Date: Wed, 15 Nov 2023 17:04:38 +0330 Subject: [PATCH] preregister bug fix --- src/utils/helpers.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 7401a79c2..ccd75b528 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -232,6 +232,18 @@ export function persianMonthStringFarsi(value: Date) { : null; } +export function persianDay(value: Date) { + if (!value) { + return null; + } + return parseInt( + new Intl.DateTimeFormat('en-US-u-ca-persian', { day: 'numeric' }).format( + value, + ), + ); +} + + export function persianMonth(value: Date) { if (!value) { return null;