From 4ade8419c792396c09dd35f8cf470dc85ad2a610 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: Fri, 7 Jun 2019 09:46:22 +0900 Subject: [PATCH] Fix: getDateTimeNow bug --- src/game/ranking/ranking.js | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/game/ranking/ranking.js b/src/game/ranking/ranking.js index 7b2a518..6a80567 100644 --- a/src/game/ranking/ranking.js +++ b/src/game/ranking/ranking.js @@ -13,27 +13,20 @@ var Ranking = { this.refreshTimeSec = Ranking.REFRESH_TIME_SEC; this.showingPageIndex = 0; + this.recordArray = null; + this.dateTime = null; this.date = ""; this.time = ""; - this.recordArray = null; - this.getDateTimeNow(); // bg this.game.stage.backgroundColor = '#4d4d4d'; - // this.bgWhite = game.add.sprite(0, 0, "bg_white"); - // this.bgWhite.width = GAME_SCREEN_SIZE.x; - // this.bgWhite.height = GAME_SCREEN_SIZE.y; - // this.setBgColor(this.timeType); var posY = 100; - // var bg = game.add.graphics(); - // bg.beginFill(0x545454, 0.8); - // bg.drawRect(0, 60, GAME_SCREEN_SIZE.x, 80); - this.bgWhite = game.add.sprite(0, 60, "bg_white"); - this.bgWhite.width = GAME_SCREEN_SIZE.x; - this.bgWhite.height = 80; + this.bgTimeline = game.add.sprite(0, 60, "bg_white"); + this.bgTimeline.width = GAME_SCREEN_SIZE.x; + this.bgTimeline.height = 80; this.setBgColor(this.timeType); @@ -463,7 +456,7 @@ var Ranking = { getDateTimeNow: function() { var now = new Date(); - var hourTimeText = DateUtil.getYYYYMMDD(now) + "T" + now.getHours() + ":00:00"; + var hourTimeText = DateUtil.getYYYYMMDD(now) + "T" + DateUtil.getFullHours(now) + ":00:00"; this.dateTime = new Date(hourTimeText); this.date = DateUtil.getYYYYMMDD(this.dateTime); this.time = DateUtil.getHHMMSS(this.dateTime); @@ -586,15 +579,15 @@ var Ranking = { setBgColor: function(timeType) { switch(timeType) { case Ranking.MODE_HOUR: - this.bgWhite.tint = 0x5f4d4d; + this.bgTimeline.tint = 0x5f4d4d; break; case Ranking.MODE_DAY: - this.bgWhite.tint = 0x4d4d5f; + this.bgTimeline.tint = 0x4d4d5f; break; case Ranking.MODE_MONTH: - this.bgWhite.tint = 0x4d5f4d; + this.bgTimeline.tint = 0x4d5f4d; break; } },