Homepage, lepsi POI
This commit is contained in:
@@ -15,35 +15,18 @@ const props = defineProps({
|
||||
minDate: {
|
||||
type: [String, Date],
|
||||
required: false
|
||||
},
|
||||
rules: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => ([]),
|
||||
}
|
||||
})
|
||||
|
||||
let dateModel = ref("");
|
||||
let timeModel = ref("");
|
||||
|
||||
let originalTime, originalDate;
|
||||
|
||||
// onMounted(() => {
|
||||
// let emitDefaultValue = false;
|
||||
// if (props.modelValue) {
|
||||
// let modelVal = props.modelValue;
|
||||
// if (typeof modelVal === 'string') {
|
||||
// modelVal = parseDate(props.modelValue);
|
||||
// emitDefaultValue = true;
|
||||
// }
|
||||
//
|
||||
// dateModel.value = formatDatetime(modelVal, "YYYY-MM-DD");
|
||||
// timeModel.value = formatDatetime(modelVal, "HH:mm:ss");
|
||||
// }
|
||||
//
|
||||
// setOriginalValues();
|
||||
// if (emitDefaultValue) {
|
||||
// emitModelUpdate();
|
||||
// }
|
||||
// });
|
||||
// TODO: ^^ by asi slo prepsat do watchera, viz ComboboxInput
|
||||
|
||||
|
||||
const publicModel = computed(() => {
|
||||
if (!dateModel.value) {
|
||||
return "";
|
||||
@@ -57,6 +40,8 @@ const popupProxy = ref(null);
|
||||
const model = computed(() => dateModel.value + "T" + timeModel.value);
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
const emitModelUpdate = () => {
|
||||
if (dateModel.value === '' || timeModel.value === '') return;
|
||||
|
||||
const val = parseDate(model.value);
|
||||
emit("update:modelValue", val);
|
||||
|
||||
@@ -128,7 +113,7 @@ watch(() => props.modelValue, (newVal) => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-input readonly v-bind="commonProps" v-model="publicModel">
|
||||
<q-input readonly v-bind="commonProps" v-model="publicModel" :rules="rules">
|
||||
<template #append>
|
||||
<q-icon name="event"/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user