From b85a5f7cf1f5c9bcfcb9e36550c54207bb453af9 Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Mon, 12 Dec 2022 16:10:59 -0500 Subject: [PATCH] Make sure lastReadTimestamp is in UTC --- src/libs/actions/Report.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 1567eb9d3cbf..f5c5669121b9 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -698,18 +698,18 @@ function readNewestAction(reportID, created) { */ function markCommentAsUnread(reportID, created) { // We subtract 1 millisecond so that the lastRead is updated to just before this reportAction's created date - const lastRead = DateUtils.getDBTime(new Date(created) - 1); + const lastReadTimestamp = Date.parse(`${created} UTC`) - 1; API.write('MarkAsUnread', { reportID, - created: lastRead, + created: DateUtils.getDBTime(lastReadTimestamp), }, { optimisticData: [{ onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, value: { - lastReadTimestamp: Date.parse(lastRead), + lastReadTimestamp, }, }], });