From a69029e272a85a37870221f1c8a52f56dfd4eaa6 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Mon, 12 Jul 2021 03:46:12 +0700 Subject: [PATCH] Update excel import on takagg excel import --- src/routes/wish/_excelImport.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/routes/wish/_excelImport.svelte b/src/routes/wish/_excelImport.svelte index e4c737f1..58c4f1ad 100644 --- a/src/routes/wish/_excelImport.svelte +++ b/src/routes/wish/_excelImport.svelte @@ -212,8 +212,6 @@ time = time.text; } - console.log(time); - let name = ''; if (type === 'weapon') { name = weapons.find((e) => e.name === fullName).id; @@ -255,8 +253,15 @@ sheet.eachRow((row, index) => { if (index === 1) return; const type = row.getCell(3).text.toLowerCase(); - const time = row.getCell(1).text; + let time = row.getCell(3); const fullName = row.getCell(2).text; + + if (time.type === ValueType.Date) { + time = dayjs.utc(time.value).format('YYYY-MM-DD HH:mm:ss'); + } else { + time = time.text; + } + let name = ''; if (type === 'weapon') { name = weapons.find((e) => e.name === fullName).id;