Commit d827192e authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent c1f4adf4
......@@ -33,7 +33,7 @@ async function run() {
for (let z = 0; z < dateString.length - 1; z++)
arrDate.push(dateString[z])
add(config[j].total,arrDate)
add(config[j].total,arrDate,config[j].type.split('targetPercentage:false')[1])
}
......@@ -51,6 +51,17 @@ async function run() {
}
}
for (let i=0;i<adder.length;i++)
{
for (let z=i+1;z<adder.length;z++)
{
let types=adder[z].type
for (let l=0;l<types.length;l++)
add(adder[i].total,adder[z].dates,types[l])
}
}
for (let i=0;i<adder.length;i++)
{
......@@ -84,7 +95,7 @@ async function run() {
}
function add(total,dates)
function add(total,dates,type)
{
let found=false
dates = _.orderBy(dates)
......@@ -97,12 +108,14 @@ function add(total,dates)
adder[i].dates=_.uniq(adder[i].dates)
adder[i].countDay=adder[i].dates.length
if (type)
adder[i].type.push(type)
}
if (found)
return
adder.push({total:total,dates:dates,countDay:dates.length})
adder.push({total:total,dates:dates,countDay:dates.length,type:type})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment