fix date parsing +1 month
parent
6d202e0192
commit
5c5430314a
|
@ -65,9 +65,11 @@ const parseWarLog = (lineArray, war) => {
|
||||||
if (line.includes('Startbudget')) {
|
if (line.includes('Startbudget')) {
|
||||||
stats.war['budgetBlufor'] = transformMoneyString(budg[9]);
|
stats.war['budgetBlufor'] = transformMoneyString(budg[9]);
|
||||||
stats.war['budgetOpfor'] = transformMoneyString(budg[12].slice(0, -1));
|
stats.war['budgetOpfor'] = transformMoneyString(budg[12].slice(0, -1));
|
||||||
|
|
||||||
// this date needs to be assigned in first place !important
|
// this date needs to be assigned in first place !important
|
||||||
const dateString = budg[0].slice(0,-1).split('/');
|
const dateString = budg[0].slice(0, -1).split('/').map(s => parseInt(s));
|
||||||
stats.war.date = new Date(dateString[0], dateString[1], dateString[2])
|
stats.war.date = new Date(dateString[0], dateString[1] - 1, dateString[2]);
|
||||||
|
|
||||||
} else if (line.includes('Endbudget')) {
|
} else if (line.includes('Endbudget')) {
|
||||||
stats.war['endBudgetBlufor'] = transformMoneyString(budg[9].substr(1));
|
stats.war['endBudgetBlufor'] = transformMoneyString(budg[9].substr(1));
|
||||||
stats.war['endBudgetOpfor'] = transformMoneyString(budg[12].slice(0, -1));
|
stats.war['endBudgetOpfor'] = transformMoneyString(budg[12].slice(0, -1));
|
||||||
|
|
Loading…
Reference in New Issue