From b1c7c705dd624b57458797881ece077cd3e62870 Mon Sep 17 00:00:00 2001 From: HardiReady Date: Thu, 2 Nov 2017 13:12:58 +0100 Subject: [PATCH] remove roundDomain for area chart; review date parse --- api/models/war.js | 1 - api/tools/log-parse-tool.js | 5 +++-- .../src/app/statistic/war-detail/war-detail.component.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/models/war.js b/api/models/war.js index 7d4cf9c..d62ec94 100644 --- a/api/models/war.js +++ b/api/models/war.js @@ -13,7 +13,6 @@ const WarSchema = new Schema({ }, endDate : { type: Date, - required: true }, ptBlufor: { type: Number, diff --git a/api/tools/log-parse-tool.js b/api/tools/log-parse-tool.js index 8830d21..6705167 100644 --- a/api/tools/log-parse-tool.js +++ b/api/tools/log-parse-tool.js @@ -65,9 +65,9 @@ const parseWarLog = (lineArray, war) => { if (line.includes('Endbudget')) { stats.war['endBudgetBlufor'] = transformMoneyString(budg[11]); stats.war['endBudgetOpfor'] = transformMoneyString(budg[14]); - war.endDate = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T0' + budg[5]); - } else if (line.includes('Startbudget')) { + stats.war.endDate = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T0' + budg[5]); stats.war.date = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T22:00:00.000'); + } else if (line.includes('Startbudget')) { stats.war['budgetBlufor'] = transformMoneyString(budg[11]); stats.war['budgetOpfor'] = transformMoneyString(budg[14]); } else { @@ -182,6 +182,7 @@ const parseWarLog = (lineArray, war) => { stats.war.playersBlufor = stats.players.filter(player => player.fraction === 'BLUFOR').length; stats.war.playersOpfor = stats.players.filter(player => player.fraction === 'OPFOR').length; + console.log(stats.war); return stats; }; diff --git a/static/src/app/statistic/war-detail/war-detail.component.html b/static/src/app/statistic/war-detail/war-detail.component.html index 97bec74..60f28d9 100644 --- a/static/src/app/statistic/war-detail/war-detail.component.html +++ b/static/src/app/statistic/war-detail/war-detail.component.html @@ -227,7 +227,7 @@ [yAxisLabel]="yAxisLabelFlag" [autoScale]="autoscale" [timeline]="timeline" - [roundDomains]="roundDomains"> + [roundDomains]="false">