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 19:02:16 +05:00 committed by GitHub
parent 7333e9fce7
commit 6077d564e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}}
>