When assigned an item, the date is changing to previous day.
Issue Description:
An altered date display may be observed after assigning an item in the action center, despite specific date assignments. The dates displayed when viewed in certain time zones can differ from the originally set dates.
Example Scenario:
For instance, consider a user selected the start and end dates as 05-06-2024 and 05-09-2024. However, the date entered has an attached EST time zone from the browser. When this data is sent to the service.
StartDate: "2024-05-06T00:00:00-04:00"
EndDate: "2024-05-09T00:00:00-04:00"
It gets stored in the UTC format on the servers.
StartDate: "2024-05-06T05:00:00Z"
EndDate: "2024-05-08T05:00:00Z"
When viewed by a user who is in the CST time zone, the web browser implicitly converts the UTC date to CST. Since CST is an hour behind EST, the time here would be 23:00:00 which belongs to the previous day. Consequently, the customer sees the date as 05-05-2024 and 05-08-2024 respectively.
Resolution:
While the discrepancy appears in the viewed date, the actual stored date remains unaffected, and thus the overall functionality of the form is not impacted. To avoid this date display change depending on user's time zone, an update can be applied to the calculateValue field in the 'Edit Json' option in the Form Task:
This command helps to maintain the date time independent of the user's timezone, ensuring the time displayed remains consistent irrespective of the viewer's local time zone.