Fix: get db data with date, time

This commit is contained in:
2018-05-24 20:48:22 +09:00
parent 82e290db86
commit 4863a8d3f1
7 changed files with 75 additions and 51 deletions
+22 -13
View File
@@ -25,23 +25,32 @@ class Start {
// contents
this.printHowToPlay(appInfoManager.getHowToPlayText(sessionStorageManager.playingAppName));
this.makeStartButton();
this.dbConnectManager.requestPlayerHistory( historyRecordManager => {
this.printChartBaseLine();
let today = new Date();
let date = DateUtil.getYYYYMMDD(today);
this.dbConnectManager.requestPlayerHistory(
date,
historyRecordManager => {
this.printChartBaseLine();
let underValue = historyRecordManager.underValueForGraph();
let upperValue = historyRecordManager.upperValueForGraph();
if(historyRecordManager.count == 0) {
console.log("start - history record : no data");
return;
}
let minValue = underValue - (upperValue - underValue) / 10;
let maxValue = upperValue;// + (upperValue - underValue) / 10;
for(let i = 0; i < historyRecordManager.count; i++) {
if(i > 6)
break;
let underValue = historyRecordManager.underValueForGraph();
let upperValue = historyRecordManager.upperValueForGraph();
let data = historyRecordManager.getAt(i);
this.drawRecordGraph(i, data.date, data.score, minValue, maxValue);
let minValue = underValue - (upperValue - underValue) / 10;
let maxValue = upperValue;// + (upperValue - underValue) / 10;
for(let i = 0; i < historyRecordManager.count; i++) {
if(i > 6)
break;
let data = historyRecordManager.getAt(i);
this.drawRecordGraph(i, data.date, data.score, minValue, maxValue);
}
}
});
);
// bottom