From 834553dabb81597d6e8e41170ad06d5146d8aeb7 Mon Sep 17 00:00:00 2001 From: christianbeeznst Date: Wed, 6 Nov 2024 12:05:16 -0500 Subject: [PATCH] Calendar: Simplify reminder message formatting - refs BT#22151 --- .../vue/composables/calendar/calendarReminders.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/assets/vue/composables/calendar/calendarReminders.js b/assets/vue/composables/calendar/calendarReminders.js index 2f7a57afa0..64b50bfb39 100644 --- a/assets/vue/composables/calendar/calendarReminders.js +++ b/assets/vue/composables/calendar/calendarReminders.js @@ -14,15 +14,16 @@ export function useCalendarReminders() { * @returns {string} */ function decodeDateInterval(reminder) { + let unit; if (reminder.period === "i") { - return t("%d minutes before", [reminder.count]) + unit = t("minutes before"); + } else if (reminder.period === "h") { + unit = t("hours before"); + } else { + unit = t("days before"); } - if (reminder.period === "h") { - return t("%d hours before", [reminder.count]) - } - - return t("%d days before", [reminder.count]) + return `${reminder.count} ${unit}`; } return {