From cdf4f98c8702f6f19f7eb6f10d22544d161728bd Mon Sep 17 00:00:00 2001 From: Alexandre Bourdin Date: Thu, 18 Apr 2024 15:54:26 +0200 Subject: [PATCH] Merge pull request #17957 from overleaf/ab-archive-test-slack-notif-date [web] Send correct date for Slack notification when archiving a split test GitOrigin-RevId: acf39915e3362f90b431b6c973e1191428acd9c9 --- .../app/src/Features/SplitTests/SlackNotificationManager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/app/src/Features/SplitTests/SlackNotificationManager.js b/services/web/app/src/Features/SplitTests/SlackNotificationManager.js index 811e62a931..7774b5fd9d 100644 --- a/services/web/app/src/Features/SplitTests/SlackNotificationManager.js +++ b/services/web/app/src/Features/SplitTests/SlackNotificationManager.js @@ -29,6 +29,8 @@ async function sendNotification(splitTest, action, user) { ), ].join('\n') + const date = splitTest.archived ? splitTest.archivedAt : lastVersion.createdAt + const payload = { name: splitTest.name, action, @@ -38,9 +40,7 @@ async function sendNotification(splitTest, action, user) { variantsConfig, active: lastVersion.active.toString(), author: user.email, - date: - moment(lastVersion.createdAt).utc().format('Do MMM YYYY, h:mm a') + - ' UTC', + date: moment(date).utc().format('Do MMM YYYY, h:mm a') + ' UTC', comment: lastVersion.comment ? `with comment: ${lastVersion.comment}` : '', versionNumber: `${lastVersion.versionNumber}`, url: `${Settings.siteUrl}/admin/split-test/edit/${splitTest.name}`,