Javascript recurring dates library
See original GitHub issueSo 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:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top GitHub Comments
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 ✌️
Thanks! I will check it out! But it’s a great addition to your already great post! 👍