#6917 - inputDate_inputTime_improviments #552
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix-front#552
Loading…
Reference in New Issue
No description provided.
Delete Branch "6917-inputDate_inputTime_improviments"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
6917-inputDate_inputTime_improvimentsto #6917 - inputDate_inputTime_improviments@ -53,2 +54,4 @@
);
}
}
let ymd = value.split('-').map((e) => parseInt(e));
porque no es const?
ymd?? year-month-day==
Propuesta
const [year, mont, day] = value.split
Era código de Juan.
Pero si en este caso si se puede cambiar
@ -44,2 +47,4 @@
time = time.substring(0, 2) + ':' + time.substring(3, 4);
}
if (!props.timeOnly) {
const hours = time.split(':');
const [hh, mm] = time.split en vez de hacer hours[0] y hours[1]
@ -46,3 +51,2 @@
const date = new Date(model.value);
date.setHours(hours[0], hours[1], 0);
time = date.toISOString();
date.setHours(hours[0] ?? 0, hours[1] ?? 0, 0);
En que casos puede ser undefined?
@ -44,0 +46,4 @@
if (time.length == 1 && parseInt(time) > 2) time = time.padStart(2, '0');
time = time.padEnd(5, '0');
if (!time.includes(':'))
time = time.substring(0, 2) + ':' + time.substring(3, 5);
(comentario/sugerncia) Okey, con regExp podria ser asi '1200'.replace(/^(\d{2})(\d{2})/, "$1:$2")
@ -64,0 +76,4 @@
if (!val || !input) return;
const [hh, mm] = val.split(':');
if (parseInt(hh) >= 10 || mm != '00') return;
porque 10?
pq menos de 10 ja es 09, 08, 07, etc
@ -64,0 +79,4 @@
if (parseInt(hh) >= 10 || mm != '00') return;
await nextTick();
await nextTick();
Porque hay 2?
Con 1 no funcionaba entiendo que vue aún no ha actualizado el valor con 1 solo
Revisamos porque en WorkerTimeControl está poniendo el foco al final del input