Add option to ignore all day events
nikolowry opened this issue · comments
Is there any intention of implementation of this feature ?
Maybe see how https://github.com/chmouel/gnome-next-meeting-applet does it ?
Is there any intention of implementation of this feature ?
Maybe see how https://github.com/chmouel/gnome-next-meeting-applet does it ?
function getTodaysEvents(calendarSource) {
const src = calendarSource;
src._loadEvents(true);
const today = new Date();
today.setHours(0, 0, 0, 0); // Get event from today at midnight
const tomorrow = new Date(today);
tomorrow.setDate(today.getDate() + 1);
let todaysEvents = src.getEvents(today, tomorrow);
todaysEvents = todaysEvents.filter(event => {
const start = event.date;
const end = event.end;
return !(start.getHours() === 0 && start.getMinutes() === 0 &&
end.getHours() === 0 && end.getMinutes() === 0);
});
return todaysEvents;
}
Thanks to @coignard, implemented and tested proposed fix in PR #19.
Hope, @artisticat1 will review and accept this.