Fix: DateUtil.getDate bug

This commit is contained in:
2018-05-30 09:13:45 +09:00
parent f1cab7de3f
commit cec653abb7
8 changed files with 23 additions and 34 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
class DateUtil {
static getYYYYMMDD(date) {
return date.toISOString().slice(0,10);
// return date.toISOString().slice(0,10);
return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
}
static getHHMMSS(date) {
+2 -2
View File
@@ -13,11 +13,11 @@ class Game {
let scoreBoard = new ScoreBoard();
scoreManager.addOnChangeScoreListener( score => {
sessionStorageManager.score = score;
sessionStorageManager.record = score;
scoreBoard.printScore(NumberUtil.numberWithCommas(score));
});
scoreManager.addOnChangeHighScoreListener( highScore => {
sessionStorageManager.highScore = highScore;
sessionStorageManager.bestRecord = highScore;
screenBottom.printBottomLeftText("최고 기록 : " + NumberUtil.numberWithCommas(highScore));
});
+1 -9
View File
@@ -23,17 +23,9 @@ class HistoryBoard {
return;
}
let maxIndex = historyRecordManager.count - 1;
if(maxIndex > 6)
maxIndex = 6;
for(let i = 0; i < historyRecordManager.count; i++) {
if(i > 6)
break;
let data = historyRecordManager.getAt(maxIndex);
let data = historyRecordManager.getAt(i);
this.printRecord(i, data.date, data.bestRecord);
maxIndex--;
}
}
);