Fix date input (#4141)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-12-05 12:26:02 +06:00 committed by GitHub
parent 54f19d4519
commit 926c2fdd9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,17 +47,16 @@
switch (id) {
case 'day':
date = new Date(timeZone ? moment(date).tz(timeZone).date(val).valueOf() : moment(date).date(val).valueOf())
date.setDate(val)
break
case 'month':
date = new Date(
timeZone
? moment(date)
.tz(timeZone)
.month(val + 1)
.month(val - 1)
.valueOf()
: moment(date)
.month(val + 1)
.month(val - 1)
.valueOf()
)
break