Fix: get db data with date, time
This commit is contained in:
@@ -13,20 +13,30 @@ class HistoryBoard {
|
||||
this.textMyRanking = game.add.text(posX, posY + 100, '', arrayTabStyle)
|
||||
.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
|
||||
this.dbConnectManager.requestPlayerHistory( historyRecordManager => {
|
||||
let maxIndex = historyRecordManager.count - 1;
|
||||
if(maxIndex > 6)
|
||||
maxIndex = 6;
|
||||
let today = new Date();
|
||||
let date = DateUtil.getYYYYMMDD(today);
|
||||
this.dbConnectManager.requestPlayerHistory(
|
||||
date,
|
||||
historyRecordManager => {
|
||||
if(historyRecordManager.count == 0) {
|
||||
console.log("history board - no data");
|
||||
return;
|
||||
}
|
||||
|
||||
for(let i = 0; i < historyRecordManager.count; i++) {
|
||||
if(i > 6)
|
||||
break;
|
||||
let maxIndex = historyRecordManager.count - 1;
|
||||
if(maxIndex > 6)
|
||||
maxIndex = 6;
|
||||
|
||||
let data = historyRecordManager.getAt(maxIndex);
|
||||
this.printRecord(i, data.date, data.score);
|
||||
maxIndex--;
|
||||
for(let i = 0; i < historyRecordManager.count; i++) {
|
||||
if(i > 6)
|
||||
break;
|
||||
|
||||
let data = historyRecordManager.getAt(maxIndex);
|
||||
this.printRecord(i, data.date, data.score);
|
||||
maxIndex--;
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user