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) { switch (id) {
case 'day': case 'day':
date = new Date(timeZone ? moment(date).tz(timeZone).date(val).valueOf() : moment(date).date(val).valueOf()) date = new Date(timeZone ? moment(date).tz(timeZone).date(val).valueOf() : moment(date).date(val).valueOf())
date.setDate(val)
break break
case 'month': case 'month':
date = new Date( date = new Date(
timeZone timeZone
? moment(date) ? moment(date)
.tz(timeZone) .tz(timeZone)
.month(val + 1) .month(val - 1)
.valueOf() .valueOf()
: moment(date) : moment(date)
.month(val + 1) .month(val - 1)
.valueOf() .valueOf()
) )
break break