#6917 - inputDate_inpuTime #498

Merged
alexm merged 16 commits from 6917-inputDate_inpuTime into dev 2024-07-03 06:52:47 +00:00
3 changed files with 21 additions and 23 deletions
Showing only changes of commit f4975d1f15 - Show all commits

View File

@ -1,5 +1,5 @@
<script setup>
Outdated
Review

Lo he rehecho desde 0, no me fijaria en lo que había

Lo he rehecho desde 0, no me fijaria en lo que había
import { computed, ref } from 'vue';
import { onMounted, watch, computed, ref } from 'vue';
import { date } from 'quasar';
import { useI18n } from 'vue-i18n';
@ -19,12 +19,18 @@ const $props = defineProps({
},
});
const emit = defineEmits(['update:modelValue']);
const { t } = useI18n();
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
const dateFormat = 'DD/MM/YYYY';
const isPopupOpen = ref(false);
const hover = ref(false);
const mask = ref();
onMounted(() => {
// fix quasar bug
mask.value = '##/##/####';
});
const styleAttrs = computed(() => {
return $props.isOutlined
@ -36,7 +42,6 @@ const styleAttrs = computed(() => {
: {};
});
const dateFormat = 'DD/MM/YYYY';
const formattedDate = computed({
get() {
if (!model.value) return model.value;
@ -50,7 +55,7 @@ const formattedDate = computed({
if (value.at(2) == '/') value = value.split('/').reverse().join('/');
value = date.formatDate(
new Date(value).toISOString(),
'YYYY-MM-DDTHH:mm:ss.SSSZ',
'YYYY-MM-DDTHH:mm:ss.SSSZ'
);
}
let ymd = value.split('-').map((e) => parseInt(e));
@ -63,7 +68,7 @@ const formattedDate = computed({
orgDate.getHours(),
orgDate.getMinutes(),
orgDate.getSeconds(),
orgDate.getMilliseconds(),
orgDate.getMilliseconds()
);
}
}
@ -72,7 +77,13 @@ const formattedDate = computed({
});
const popupDate = computed(() =>
model.value ? date.formatDate(new Date(model.value), 'YYYY/MM/DD') : model.value,
model.value ? date.formatDate(new Date(model.value), 'YYYY/MM/DD') : model.value
);
watch(
() => model.value,
(val) => (formattedDate.value = val),
{ immediate: true }
);
</script>
@ -81,7 +92,7 @@ const popupDate = computed(() =>
<QInput
v-model="formattedDate"
class="vn-input-date"
mask="##/##/####"
:mask="mask"
placeholder="dd/mm/aaaa"
v-bind="{ ...$attrs, ...styleAttrs }"
alexm marked this conversation as resolved Outdated

PAra que en TicketCreate.vue quiero que el campo sea clearable tengo que poner la propiedad a mano

PAra que en TicketCreate.vue quiero que el campo sea clearable tengo que poner la propiedad a mano
:class="{ required: $attrs.required }"

View File

@ -17,15 +17,6 @@ const props = defineProps({
},
});
const from = Date.vnNew();
Outdated
Review

Estos filtros ya están en TicketList, no creo que haga falta que estén duplicados

Estos filtros ya están en TicketList, no creo que haga falta que estén duplicados
const to = Date.vnNew();
to.setDate(to.getDate() + 1);
const defaultParams = {
from: toDateString(from),
to: toDateString(to),
};
const workers = ref();
const provinces = ref();
const states = ref();
@ -44,11 +35,7 @@ const warehouses = ref();
@on-fetch="(data) => (workers = data)"
auto-load
/>
<VnFilterPanel
:data-key="props.dataKey"
:params="defaultParams"
:search-button="true"
>
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>

View File

@ -26,8 +26,8 @@ const to = Date.vnNew();
to.setDate(to.getDate() + 1);
const userParams = {
Outdated
Review

(Aquí)

(Aquí)
from: toDateString(from),
to: toDateString(to),
from: from.toISOString(),
to: to.toISOString(),
};
function navigate(id) {