diff --git a/src/components/ModalSelectDate.vue b/src/components/ModalSelectDate.vue index 61bfab329ea..2650b185357 100644 --- a/src/components/ModalSelectDate.vue +++ b/src/components/ModalSelectDate.vue @@ -11,16 +11,6 @@ const { open } = toRefs(props); const step = ref(0); const input = ref(''); const time = ref('12:00'); -const isTimeValid = computed(() => { - const isTimeEnteringStep = step.value === 1; - if (!isTimeEnteringStep) return true; - if (!input.value) return false; - - const startDateString = `${input.value} ${time.value}:59`; - const startTimestamp = new Date(startDateString).getTime(); - - return startTimestamp >= Date.now(); -}); function formatDate(date) { const output = { h: '12', m: '00', dateString: '' }; @@ -38,8 +28,7 @@ function handleSubmit() { if (step.value === 0) return (step.value = 1); const dateString = `${input.value} ${time.value}:00`; const timestamp = new Date(dateString).getTime() / 1000; - const now = parseInt((Date.now() / 1e3).toFixed()); - emit('input', Math.max(timestamp, now)); + emit('input', timestamp); emit('close'); } @@ -50,17 +39,6 @@ watch(open, () => { time.value = `${h}:${m}`; input.value = dateString; }); - -watch(step, () => { - if (step.value === 0) return; - const timestamp = Math.max( - props.value, - parseInt((Date.now() / 1e3 + 10).toFixed()) - ); - const { dateString, h, m } = formatDate(timestamp); - time.value = `${h}:${m}`; - input.value = dateString; -});