forked from mirrors/homebox
refactor: editor page (#276)
This commit is contained in:
parent
9361997a42
commit
986d2c586e
3 changed files with 82 additions and 34 deletions
|
@ -18,7 +18,7 @@
|
|||
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Date,
|
||||
type: Date as () => Date | string,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
|
@ -32,6 +32,10 @@
|
|||
get() {
|
||||
// return modelValue as string as YYYY-MM-DD or null
|
||||
if (validDate(props.modelValue)) {
|
||||
if (typeof props.modelValue === "string") {
|
||||
return props.modelValue;
|
||||
}
|
||||
|
||||
return props.modelValue ? props.modelValue.toISOString().split("T")[0] : null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue