Changing report dates

Hello
I have an issue with the dates in the tasks data all the dates are being changed from the date a task was submitted to another date. I don’t know what is causing this and I will need your assistance in fixing it. In the picture below this is the same task the authoredOn date should be the same as the report date but they re turning out different.

Hi @Victory, welcome to the CHT forum.

Our CHT docs seem to lack details on how a task doc’s authoredOn field is calculated.

Here is what I found from the cht-core source:

From above, we can see that the authoredOn field holds the value of calculatedAt, which is:

Epoch timestamp at the time the emission was calculated

This can be different from the source report’s reported_date because a task is emitted sometime after the source report has been submitted. Also, a newer task emission can update the task document’s state.

In your example above, the authoredOn and stateHistory.timestamp have the same timestamp. It looks like your task was completed at the time it was first created.

Can you please share more about your task configuration, and how you are trying to make use of the authoredOn field?

1 Like