OpenFn / unicef-cambodia

UNICEF Cambodia - Primero Interoperability
https://openfn.github.io/unicef-cambodia/
1 stars 2 forks source link

Date filter not returned in correct format #13

Closed aleksa-krolls closed 4 years ago

aleksa-krolls commented 4 years ago

https://github.com/OpenFn/unicef-cambodia/blob/91c0b7e27addca4639b37b2380ee032514149989/jobs/f2-j1-getOscarCases.js#L25

In GET request to Oscar, state.lastQueryDate returns this value 1587772527000 instead of '2020-01-01' (YYYY-MM-DD). Causes error.


query: {
      since_date: state.lastQueryDate || '2020-01-01',
    }
aleksa-krolls commented 4 years ago

@taylordowns2000 We need to return date in the format '2020-01-01 00:00:00', so please add the timestamp to what we have here.

https://github.com/OpenFn/unicef-cambodia/blob/932c0121fe8778ec463e0b182f2034eb27059902/jobs/f2-j1-getOscarCases.js#L36

FYI - For now we will keep the date filters as is pending further discussion & testing.

taylordowns2000 commented 4 years ago

@aleksa-krolls , see this above (last) commit. can you confirm that this filter should be submitted in UTC time?

aleksa-krolls commented 4 years ago

@taylordowns2000 Yes, that works