remove vars with duplicate values
This commit is contained in:
parent
52fe090a53
commit
f5a30013e3
@ -87,24 +87,21 @@ function display_event_date(item) {
|
||||
|
||||
if (start_time === "00:00" && end_time === "00:00") {
|
||||
// localtime "all-day" event
|
||||
const end_day = new Date(end.valueOf());
|
||||
const end_day_date = fmt_date.format(end_day);
|
||||
if (start_date === end_day_date) {
|
||||
if (start_date === end_date) {
|
||||
return display_date_local(start, start_date);
|
||||
} else {
|
||||
return m("span.timerange", display_date_local(start, start_date), " - ", display_date_local(end_day, end_day_date));
|
||||
return m("span.timerange", display_date_local(start, start_date), " - ", display_date_local(end, end_date));
|
||||
}
|
||||
}
|
||||
|
||||
if (start.getUTCHours() === 0 && start.getUTCMinutes() === 0 && end.getUTCHours() === 0 && end.getUTCMinutes() === 0) {
|
||||
// UTC "all-day" event
|
||||
const end_day = new Date(end.valueOf());
|
||||
const utc_start_date = fmt_date_utc.format(start);
|
||||
const utc_end_day_date = fmt_date_utc.format(end_day);
|
||||
const utc_end_day_date = fmt_date_utc.format(end);
|
||||
if (utc_start_date === utc_end_day_date) {
|
||||
return display_date_utc(start, utc_start_date);
|
||||
} else {
|
||||
return m("span.timerange", display_date_utc(start, utc_start_date), " - ", display_date_utc(end_day, utc_end_day_date));
|
||||
return m("span.timerange", display_date_utc(start, utc_start_date), " - ", display_date_utc(end, utc_end_day_date));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user