Calendar: Simplify reminder message formatting - refs BT#22151

pull/5913/head
christianbeeznst 2 weeks ago
parent d5a14e7bb7
commit 834553dabb
  1. 13
      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 {

Loading…
Cancel
Save