From 76994fdbe9883d3a92c2b0b322213d0ab1de6447 Mon Sep 17 00:00:00 2001 From: capitanwesler Date: Tue, 13 Apr 2021 09:32:29 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=A2=20Changing=20date=20format=20on=20?= =?UTF-8?q?the=20nextEpisodeDate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/util.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils/util.ts b/src/utils/util.ts index d2108dd..df10448 100644 --- a/src/utils/util.ts +++ b/src/utils/util.ts @@ -561,7 +561,7 @@ export const monoschinosInfo = async ( } let broadCastDate = new Date(); - let dd: number, mm: number, yyyy: number; + let dd: number, mm: string | number, yyyy: number; const airDay: any = { Lunes: 1, @@ -585,11 +585,14 @@ export const monoschinosInfo = async ( } dd = broadCastDate.getDate(); - mm = broadCastDate.getMonth(); + mm = + broadCastDate.getMonth() + 1 < 10 + ? `0${broadCastDate.getMonth() + 1}` + : broadCastDate.getMonth() + 1; yyyy = broadCastDate.getFullYear(); episodeList.push({ - nextEpisodeDate: `${dd}/${mm + 1}/${yyyy}`, + nextEpisodeDate: `${yyyy}/${mm}/${dd}/`, }); } }