question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Javascript recurring dates library

See original GitHub issue

So angular-calendar is awesome 😃

I’m using it in a project I’m working on with some rather complex recurring schedules. I ended up making a new javascript (typescript) recurrence library which implements the ICAL spec to handle it: rSchedule.

This is really just an FYI, but I wanted to call out the fact that I think it pairs particularly well with your library for two reasons:

1.

After creating a recurring schedule, the library can automatically return ordered recurrences by “calendar month”. This can either be grouped by the start and end of the actual month, or by the start of the first week of the month and end of the last week of the month (which can include dates in the preceding and next months). This makes it easy to get dates for the month view of angular-calendar.

const calendar = new Calendar({
  schedules: new RRule({
    start: new Date(),
    frequency: 'DAILY',
    byDayOfWeek: ['MO']
  })
})

const iterator = calendar.collections({
  granularity: 'MONTHLY',
  weekStart: 'MO'
})

for (const collection of iterator) {
  // yields a collection object containing all the dates for that month

  for (const date of collection.dates) {
    // do stuff
  }
}

// or just get the next collection

const collection = calendar.collections({
  start: new Date()
  granularity: 'MONTHLY'
  weekStart: 'MO'
}).next().value

2.

Like angular-calendar, rSchedule makes use of a DateAdapter interface so that it is date library agnostic. DateAdapters for the standard javascript Date object, as well as Moment and luxon DateTime objects exist. When using moment-timezone or luxon date adapters, rSchedule has full time zone support.

Anyway, thanks so much for your work maintaining angular-calendar!!!

You can learn more about rSchedule over in it’s repo.

Is your feature request related to a problem? Please describe

Describe the solution you’d like

Describe your use case for implementing this feature

Additional context

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mattlewis92commented, Sep 4, 2018

Sweet, thanks for taking the time to explain that, it makes a lot of sense! I’ve added a link to your lib in the recurring demo as an alternative to rrule ✌️

1reaction
meiuqercommented, Nov 29, 2018

Thanks! I will check it out! But it’s a great addition to your already great post! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

rSchedule: a javascript recurring events library | by John Carroll
rSchedule is a javascript library, written in typescript, for working with recurring dates/events. Rules can be imported / exported in iCal ...
Read more >
jorroll/rschedule - GitHub
A javascript library, written in typescript, for working with recurring dates. The library is "date agnostic" and usable with Date , Moment, luxon,...
Read more >
recurring events - npm search
A typescript library for working with recurring dates and events. rschedule · javascript · typescript · recurring · events · dates · recurrences...
Read more >
Calculate the recurring dates between a range of dates in ...
This function gives a date for every [interval] and [intervalType] (e.g. ... I reused the library later.js for the recurrence functionality.
Read more >
Javascript Event calendar Recurrence rules Example
Configure daily , weekly , monthly and yearly recurring events. On top of setting up recurrence, you can exclude specific and recurring days ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found