Commit 5c618419 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent fdfb9d9d
...@@ -63,6 +63,7 @@ async function run() { ...@@ -63,6 +63,7 @@ async function run() {
function add(total,dates) function add(total,dates)
{ {
let found=false let found=false
dates = _.orderBy(dates)
for (let i=0;i<adder.length;i++) for (let i=0;i<adder.length;i++)
if (adder[i].total === total) if (adder[i].total === total)
{ {
...@@ -71,12 +72,13 @@ function add(total,dates) ...@@ -71,12 +72,13 @@ function add(total,dates)
adder[i].dates.push(dates[z]) adder[i].dates.push(dates[z])
adder[i].dates=_.uniq(adder[i].dates) adder[i].dates=_.uniq(adder[i].dates)
adder[i].countDay=adder[i].dates.length
} }
if (found) if (found)
return return
adder.push({total:total,dates:dates}) adder.push({total:total,dates:dates,countDay:dates.length})
} }
......
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