DEV Community

Discussion on: Getting Started with Angular & Apollo

Collapse
 
johncarroll profile image
John Carroll • Edited

While not the focus of this post, you can use a library like rSchedule to process recurring event schedules and get upcoming occurrences.

const schedule = new Rule({
  start: new Date(2011, 1, 7),
  frequency: 'DAILY',
  byDayOfWeek: ['MO'],
});

const occurrencesThisMonth =
  schedule
    .occurrences({ take: 5 })
    .toArray();