From 1c52eb639eba2c433a8c308b5ad856af2e8c455d Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Fri, 7 Jul 2023 11:13:29 +0900 Subject: [PATCH] =?UTF-8?q?dateFormat,=20timeFormat,=20datetimeFormat=20->?= =?UTF-8?q?=20parse(value)=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/resources/js/base/dataset.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/webapp/resources/js/base/dataset.js b/src/main/webapp/resources/js/base/dataset.js index 9ec9861..7eb0ebf 100644 --- a/src/main/webapp/resources/js/base/dataset.js +++ b/src/main/webapp/resources/js/base/dataset.js @@ -59,6 +59,10 @@ const dateFormat = { case "string": return value.substr(0, 4) + "-" + value.substr(4, 2) + "-" + value.substr(6, 2); default: return ""; } + }, + + parse(value) { + return isEmpty(value) ? "" : value.replace(/-/gi, ""); } }; @@ -85,6 +89,10 @@ const timeFormat = { return value.substr(0 + offset, 2) + ":" + value.substr(2 + offset, 2) + ":" + value.substr(4 + offset) default: return ""; } + }, + + parse(value) { + return isEmpty(value) ? "" : value.replace(/:/gi, ""); } } @@ -101,6 +109,10 @@ const datetimeFormat = { case "string": return dateFormat.format(value) + " " + timeFormat.format(value); default: return ""; } + }, + + parse(value) { + return isEmpty(value) ? "" : timeFormat.parse(dateFormat.parse(value)).replace(/ /gi, ""); } };