Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -994,18 +994,21 @@ function formatEnd(
|
||||
|
||||
const formatDatePart = (d: Date) =>
|
||||
d.toLocaleDateString("en-CA", { timeZone }); // YYYY-MM-DD format
|
||||
const sameDay = formatDatePart(startDate) === formatDatePart(endDate);
|
||||
|
||||
if (allday) {
|
||||
const inclusiveEndDate = new Date(endDate);
|
||||
inclusiveEndDate.setDate(inclusiveEndDate.getDate() - 1);
|
||||
const sameDay =
|
||||
formatDatePart(startDate) === formatDatePart(inclusiveEndDate);
|
||||
return sameDay
|
||||
? null
|
||||
: endDate.toLocaleDateString(t("locale"), {
|
||||
: inclusiveEndDate.toLocaleDateString(t("locale"), {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
timeZone,
|
||||
});
|
||||
} else {
|
||||
const sameDay = formatDatePart(startDate) === formatDatePart(endDate);
|
||||
if (sameDay) {
|
||||
return endDate.toLocaleTimeString(t("locale"), {
|
||||
hour: "2-digit",
|
||||
|
||||
Reference in New Issue
Block a user