mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-18 05:02:14 +01:00
fix 0 values do no update time entry, fix duplicate requests on time entry update
This commit is contained in:
@@ -37,14 +37,17 @@ watch(focused, (newValue, oldValue) => {
|
|||||||
updateTimeEntry();
|
updateTimeEntry();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const open = ref(false);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<Dropdown
|
<Dropdown
|
||||||
|
v-model="open"
|
||||||
|
@submit="open = false"
|
||||||
align="bottom"
|
align="bottom"
|
||||||
:close-on-content-click="false"
|
:close-on-content-click="false">
|
||||||
@submit="updateTimeEntry">
|
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<button
|
<button
|
||||||
data-testid="time_entry_range_selector"
|
data-testid="time_entry_range_selector"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const minutes = computed(() => {
|
|||||||
function updateMinutes(event: Event) {
|
function updateMinutes(event: Event) {
|
||||||
const target = event.target as HTMLInputElement;
|
const target = event.target as HTMLInputElement;
|
||||||
const newValue = target.value;
|
const newValue = target.value;
|
||||||
if (parseInt(newValue)) {
|
if (!isNaN(parseInt(newValue))) {
|
||||||
model.value = dayjs(model.value)
|
model.value = dayjs(model.value)
|
||||||
.utc()
|
.utc()
|
||||||
.set('minutes', parseInt(newValue))
|
.set('minutes', parseInt(newValue))
|
||||||
@@ -28,7 +28,7 @@ function updateMinutes(event: Event) {
|
|||||||
function updateHours(event: Event) {
|
function updateHours(event: Event) {
|
||||||
const target = event.target as HTMLInputElement;
|
const target = event.target as HTMLInputElement;
|
||||||
const newValue = target.value;
|
const newValue = target.value;
|
||||||
if (parseInt(newValue)) {
|
if (!isNaN(parseInt(newValue))) {
|
||||||
model.value = dayjs(model.value)
|
model.value = dayjs(model.value)
|
||||||
.utc()
|
.utc()
|
||||||
.set('hours', parseInt(newValue))
|
.set('hours', parseInt(newValue))
|
||||||
|
|||||||
Reference in New Issue
Block a user