Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -54,6 +54,15 @@ export const checkIfCurrentWeekOrDay = (): boolean => {
|
||||
return !!nowIndicator;
|
||||
};
|
||||
|
||||
export function formatEventChipTitle(e: CalendarEvent, t: Function) {
|
||||
if (!e.title) {
|
||||
return t("event.untitled");
|
||||
}
|
||||
return e.title === "Busy" && e.class === "PRIVATE"
|
||||
? t("event.form.busy")
|
||||
: e.title;
|
||||
}
|
||||
|
||||
export const eventToFullCalendarFormat = (
|
||||
filteredEvents: CalendarEvent[],
|
||||
filteredTempEvents: CalendarEvent[],
|
||||
@@ -66,14 +75,14 @@ export const eventToFullCalendarFormat = (
|
||||
if (e.calId.split("/")[0] === userId) {
|
||||
return {
|
||||
...e,
|
||||
title: e.title ? e.title : t("event.untitled"),
|
||||
title: formatEventChipTitle(e, t),
|
||||
colors: e.color,
|
||||
editable: true,
|
||||
};
|
||||
}
|
||||
return {
|
||||
...e,
|
||||
title: e.title ? e.title : t("event.untitled"),
|
||||
title: formatEventChipTitle(e, t),
|
||||
colors: e.color,
|
||||
editable: false,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user