
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Recurring events library for JavaScript calendar applications.
Cyclical lets you list recurring events with complex recurrence rules like "every 4 years, the first Tuesday after a Monday in November" in a simple way. The API is inspired by ice_cube and uses method chaining for natural rule specification.
You can find out if a given time matches the schedule, list event occurrences or add event duration and list suboccurrences in a given interval, which is handy when you need to trim event occurences to the interval (like rendering a day in a week view of a calendar with events crossing midnight).
Cyclical was originally extracted from a browser based calendar application and is written in Coffeescript. The plan is to translate it to plain JavaScript in the future.
You can install Cyclical using npm
npm install cyclical
or download dist/cyclical.x.js or dist/cyclical.x.min.js file.
Cyclical currently depends on date.js and underscore.js. See package.json for specific versions.
The central thing in Cyclical is the Schedule. Let's take the example of U.S. Presidential Election day from RFC 5545:
date = new Date(1997, 8, 2, 9, 0, 0);
schedule = new Schedule(date, Schedule.Rule.yearly(4).month(11).weekday('tue').monthdays(2, 3, 4, 5, 6, 7, 8));
election_dates = schedule.first(3);
Each schedule has a base date and a recurrence rule. The four supported rules are:
with corresponding factory methods on Schedule.Rule. The factory methods take a single argument - the repetition interval.
The basic recurrence rule matches the original date, i.e. for a yearly rule, the occurences will always happen on the same date. To specify a more complex pattern, you can use filters.
Filters replace the single value (day, month) with a set of values that match. For example, instead of only matching the day of month in of the base date, with the monthdays filter, you can match multiple month days.
Available filters are:
Each filter methord takes variable arguments containing integers or string (incl. shortcuts) for a given date component.
You can limit the schedule either by a number of events (using the count method) or an end date (using the stop method).
TODO. See lib/schedule.js.coffee
TODO. See lib/schedule.js.coffee
TODO
Cyclical is released under the MIT License.
FAQs
Recurring events library for calendar applications
The npm package cyclical receives a total of 3 weekly downloads. As such, cyclical popularity was classified as not popular.
We found that cyclical demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.