From 4090922e7e887db9d4b0654011fd2583f9e4ee94 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sun, 22 Mar 2020 09:21:21 +0900 Subject: [PATCH] =?UTF-8?q?CI=E9=80=9A=E3=82=89=E3=81=AA=E3=81=84=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#6173)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CI通らないの修正 * Revert "CI通らないの修正" This reverts commit 3eab7eab90050d60f0222ac0d08da7be0a53c300. * ts-ignore * んー --- src/prelude/time.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/prelude/time.ts b/src/prelude/time.ts index a65366d74a..34e8b6b17c 100644 --- a/src/prelude/time.ts +++ b/src/prelude/time.ts @@ -5,7 +5,17 @@ const dateTimeIntervals = { }; export function dateUTC(time: number[]): Date { - return new Date(Date.UTC(...time)); + const d = time.length === 2 ? Date.UTC(time[0], time[1]) + : time.length === 3 ? Date.UTC(time[0], time[1], time[2]) + : time.length === 4 ? Date.UTC(time[0], time[1], time[2], time[3]) + : time.length === 5 ? Date.UTC(time[0], time[1], time[2], time[3], time[4]) + : time.length === 6 ? Date.UTC(time[0], time[1], time[2], time[3], time[4], time[5]) + : time.length === 7 ? Date.UTC(time[0], time[1], time[2], time[3], time[4], time[5], time[6]) + : null; + + if (!d) throw 'wrong number of arguments'; + + return new Date(d); } export function isTimeSame(a: Date, b: Date): boolean {