Homepage, lepsi POI

This commit is contained in:
Michal Kváček
2023-08-23 21:40:32 +02:00
parent 8c3b8d19dd
commit 19b078b43c
33 changed files with 370 additions and 141 deletions
+8 -23
View File
@@ -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>