fix error in update me
This commit is contained in:
@@ -9,6 +9,8 @@ import DatePicker from './datePick'
|
||||
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
|
||||
@@ -26,7 +28,7 @@ const _attrs = computed(() => {
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
value: '',
|
||||
format: 'YYYY/MM/DD',
|
||||
format: 'YYYY-MM-DD',
|
||||
inputReadOnly:true
|
||||
})
|
||||
|
||||
@@ -39,7 +41,7 @@ const _date = computed({
|
||||
set: (val) => {
|
||||
let temp: string | null = null
|
||||
if (val) {
|
||||
temp = val.calendar('gregory').locale('en').format(props.format)
|
||||
temp = persianToEnglishDigits(val.calendar('gregory').locale('en').format(props.format))
|
||||
}
|
||||
emit('update:value', temp)
|
||||
emit('onchange', temp)
|
||||
|
||||
Reference in New Issue
Block a user