Skip to content
This repository was archived by the owner on Aug 15, 2020. It is now read-only.
This repository was archived by the owner on Aug 15, 2020. It is now read-only.

How to capture events for a single day #44

Description

@midzer

Hi all.
from parsed .ics data i want to extract events that happen on a specific day (when cycling through rendering of a monthly calendar for example).

This is what i tried:

var startDate = new Date(date); // specific day at 0:00
var endDate = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate(), 23, 59, 59);
var eventsInDay = [];
for (var i = 0; i < allEvents.length; i++) {
    if (allEvents[i].inTimeRange(startDate, endDate)) {
        eventsInDay.push(allEvents[i]);
    }
}

Miserably inTimeRange() returns true for all events on every day, although my recurring events only happen one time a month.

What is wrong with my implementation?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions