chore: remove console.log
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2025-04-17 08:51:04 +02:00
parent 9b1eaf949a
commit f99271289d
1 changed files with 9 additions and 10 deletions

View File

@ -68,19 +68,19 @@ const formatDate = () => {
if (!value || value === model.value) {
textColor.value = '';
return;
}
}
const regex =
/^([0]?[1-9]|[12][0-9]|3[01])([./-])([0]?[1-9]|1[0-2])([./-](\d{1,4}))?$/;
if (!regex.test(value)){
if (!regex.test(value)) {
textColor.value = errColor;
return;
}
}
value = value.replace(/[.-]/g, '/');
const parts = value.split('/');
if (parts.length < 2) {
textColor.value = errColor;
return;
return;
}
let [day, month, year] = parts;
@ -107,13 +107,13 @@ const formatDate = () => {
let isoCandidate = `${year}/${month}/${day}`;
isoCandidate = date.formatDate(
new Date(isoCandidate).toISOString(),
'YYYY-MM-DDTHH:mm:ss.SSSZ',
);
new Date(isoCandidate).toISOString(),
'YYYY-MM-DDTHH:mm:ss.SSSZ',
);
const [isoYear, isoMonth, isoDay] = isoCandidate.split('-').map((e) => parseInt(e));
const parsedDate = new Date(isoYear, isoMonth - 1, isoDay);
const isValidDate =
const isValidDate =
parsedDate instanceof Date &&
!isNaN(parsedDate) &&
parsedDate.getFullYear() === parseInt(year) &&
@ -158,7 +158,6 @@ const handleEnter = (event) => {
<template>
<div @mouseover="hover = true" @mouseleave="hover = false">
{{ console.log($q) }}
<QInput
ref="vnInputDateRef"
v-model="inputValue"
@ -168,7 +167,7 @@ const handleEnter = (event) => {
:class="{ required: isRequired }"
:rules="mixinRules"
:clearable="false"
:input-style="{color: textColor}"
:input-style="{ color: textColor }"
@click="isPopupOpen = !isPopupOpen"
@keydown="isPopupOpen = false"
@blur="formatDate"