From 26fb8bbf57d025891a300bb29ac672eaa7fb2c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Tue, 4 Jun 2019 22:49:21 +0900 Subject: [PATCH] Fix: dateutil getYYYYMMDD --- src/game/lib/util/date_util.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/game/lib/util/date_util.js b/src/game/lib/util/date_util.js index bae3a69..25b9a37 100644 --- a/src/game/lib/util/date_util.js +++ b/src/game/lib/util/date_util.js @@ -3,7 +3,10 @@ function DateUtil() { DateUtil.getYYYYMMDD = function(date) { // return date.toISOString().slice(0,10); - return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate(); + var yymmdd = date.getFullYear() + "-" + + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + + ("0" + date.getDate()).slice(-2); + return yymmdd; } DateUtil.getHHMMSS = function(date) {