This commit is contained in:
Konstantin Mamalakis 2018-03-16 17:54:44 +02:00 committed by Josh Harvey
parent 65f0e852d0
commit 577a85c9b1
3 changed files with 13 additions and 7 deletions

View file

@ -54,6 +54,12 @@ const parseSource = source => {
const readStream = fs.createReadStream(source)
const jsonStream = readStream.pipe(ndjson.parse())
jsonStream.on('data', individual => {
_.forEach(period => {
_.forEach(date => {
const {year, month, day} = date
date.date = new Date(year, month - 1, day)
}, [period.start, period.end])
}, individual.birthDatePeriods)
individuals.push(individual)
})