refactor: time problem
This commit is contained in:
parent
5775c9d5f1
commit
d060ae5f92
3 changed files with 11 additions and 7 deletions
|
|
@ -16,7 +16,11 @@ const props = defineProps<{
|
|||
}>();
|
||||
|
||||
function valueUpdate(value: string) {
|
||||
if (typeof model.value === 'string') model.value = new Date(model.value);
|
||||
if (props.readonly) return;
|
||||
|
||||
if (model.value && !(model.value instanceof Date)) {
|
||||
model.value = new Date(model.value);
|
||||
}
|
||||
|
||||
if (value.length === 10) {
|
||||
const _date = parseAndFormatDate(value, i18n.locale.value);
|
||||
|
|
@ -43,8 +47,6 @@ function valueUpdate(value: string) {
|
|||
} else {
|
||||
model.value = _date;
|
||||
}
|
||||
} else {
|
||||
model.value = model.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue