Skip to content

Commit

Permalink
[email protected]'s change on OpenFn.org
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksa-krolls committed Sep 24, 2024
1 parent ec14e83 commit 8f0a9b3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ngrt/2019.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ upsert('WCSPROGRAMS_KoboNrgtNrgtanswer', 'AnswerId', {
},
Surveyor: dataValue('surveyor'),
GovGroup: dataValue('gov_group'),
SurveyDate: state => {
const date = state.data.today || state.data._submission_time
if (Number(date.split('-')[0]) >= 2014 ) {
return date
}
return 2019
// If the time/date is not properly set on the device used to collect the data, the year of "today" will be 2000.
// With the code above we are replacing any 2000 by 2019:
},
LastUpdate: new Date().toISOString(),
});
upsert('WCSPROGRAMS_KoboNrgtNrgtanswergs', 'AnswerId', {
Expand All @@ -60,6 +69,8 @@ upsert('WCSPROGRAMS_KoboNrgtNrgtanswergs', 'AnswerId', {
return date
}
return 2019
// If the time/date is not properly set on the device used to collect the data, the year of "today" will be 2000.
// With the code above we are replacing any 2000 by 2019:
},
Gender: dataValue('gender'),
Member: dataValue('member'),
Expand Down

0 comments on commit 8f0a9b3

Please sign in to comment.