Commit f9e59bd7 authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 54978279
This diff is collapsed.
...@@ -129,16 +129,19 @@ async function run(root,name, directory, timestamp) { ...@@ -129,16 +129,19 @@ async function run(root,name, directory, timestamp) {
} }
let newLast=[] let newLast=[]
let jj='['
for (let i=0;i<las.length;i++) for (let i=0;i<las.length;i++)
{ {
let f={closeDate:las[i].closeDate,profitLossString:las[i].profitLossString,sideString:las[i].sideString} let inline='{"closeDate":"'+las[i].closeDate+'","profitLossString":"'+las[i].profitLossString+'","sideString":"'+las[i].sideString+'"}'
newLast.push(f) if (i !==(las.length-1))
inline=inline+','
jj=jj+inline
} }
console.log(las.length) jj=jj+']'
//console.log(las.length)
createfileADV(root,timestamp, name, JSON.stringify(newLast, null, 2)) createfileADV(root,timestamp, name, jj)
last = [] last = []
} }
......
...@@ -54,19 +54,41 @@ let fs = require('fs') ...@@ -54,19 +54,41 @@ let fs = require('fs')
// }); // });
// } // }
let year = ['2017', '2018', '2019', '2020', '2021', '2022'] // let year = ['2017', '2018', '2019', '2020', '2021', '2022']
let month = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'] // let month = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
//
//
// let dates = []
// for (let i = 0; i < year.length; i++) {
// for (let j = 0; j < month.length; j++) {
// let t = year[i] + '-' + month[j]
// if (!(t === '2017-01' || t === '2017-02' || t === '2017-03' || t === '2017-04' || t === '2017-05' || t === '2017-06' || t === '2017-07' || t === '2022-05' ||t === '2022-06' || t === '2022-07' || t === '2022-08' || t === '2022-09' || t === '2022-10' || t === '2022-11' || t === '2022-12'))
// dates.push(t)
// }
// }
// let t={closeDate:"1",profitLossString:"2",sideString:"3"}
// let arr=[]
// arr.push(t)
// arr.push(t)
// console.log(JSON.stringify(arr))
let dates = [] test()
for (let i = 0; i < year.length; i++) { async function test()
for (let j = 0; j < month.length; j++) { {
let t = year[i] + '-' + month[j] let las = await fs.readFileSync('t.json', 'utf8');
if (!(t === '2017-01' || t === '2017-02' || t === '2017-03' || t === '2017-04' || t === '2017-05' || t === '2017-06' || t === '2017-07' || t === '2022-05' ||t === '2022-06' || t === '2022-07' || t === '2022-08' || t === '2022-09' || t === '2022-10' || t === '2022-11' || t === '2022-12')) las=JSON.parse(las)
dates.push(t) let jj='['
for (let i=0;i<las.length;i++)
{
let inline='{"closeDate":"'+las[i].closeDate+'","profitLossString":"'+las[i].profitLossString+'","sideString":"'+las[i].sideString+'"}'
if (i !==(las.length-1))
inline=inline+','
jj=jj+inline
} }
jj=jj+']'
console.log(JSON.parse(jj))
} }
console.log(arr)
// //
......
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