TSK-942: add hours to current time (#2837)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov
2023-03-27 21:02:16 +07:00
committed by GitHub
parent 7333e9fce7
commit 6077d564e9
@@ -86,7 +86,9 @@
<div
class="btn"
on:click={() => {
const shiftedDate = new Date(currentDate.getTime() + value * base)
const abs = Math.abs(value)
let shiftedDate = new Date(currentDate.getTime() + value * base)
if (abs < DAY && abs >= HOUR) shiftedDate = new Date(Date.now() + value * base)
dispatch('change', shiftedDate)
}}
>