diff --git a/src/core/components/BaseDatePicker/src/BaseDatePicker.vue b/src/core/components/BaseDatePicker/src/BaseDatePicker.vue index c492283..f20f0dd 100644 --- a/src/core/components/BaseDatePicker/src/BaseDatePicker.vue +++ b/src/core/components/BaseDatePicker/src/BaseDatePicker.vue @@ -10,13 +10,12 @@ import locale from 'ant-design-vue/es/date-picker/locale/fa_IR' import dayjs, { Dayjs } from 'dayjs' import { omit } from 'lodash' import { computed, useAttrs } from 'vue' -import { persianToEnglishDigits } from '@/utils/persianDigits' interface Props { value?: string | Dayjs size?: string format?: string - inputReadOnly?:boolean + inputReadOnly?: boolean } const attrs = useAttrs() @@ -41,7 +40,7 @@ const _date = computed({ set: (val) => { let temp: string | null = null if (val) { - temp = persianToEnglishDigits(val.calendar('gregory').locale('en').format(props.format)) + temp = val.calendar('gregory').locale('en').format(props.format) } emit('update:value', temp) emit('onchange', temp) diff --git a/src/utils/persianDigits.ts b/src/utils/persianDigits.ts deleted file mode 100644 index e985219..0000000 --- a/src/utils/persianDigits.ts +++ /dev/null @@ -1,13 +0,0 @@ -const PERSIAN_DIGITS = '۰۱۲۳۴۵۶۷۸۹' -const ARABIC_DIGITS = '٠١٢٣٤٥٦٧٨٩' - -export function persianToEnglishDigits(value: string | number | null | undefined): string { - if (value == null) { - return '' - } - - return String(value) - .replace(/[۰-۹]/g, (d) => String(PERSIAN_DIGITS.indexOf(d))) - .replace(/[٠-٩]/g, (d) => String(ARABIC_DIGITS.indexOf(d))) - .replace(/٫/g, '.') -}