Skip to content

Converts a RRULE (iCalendar RFC-5545) to Cisco's WebEx recurrence repeat XML tree

License

Notifications You must be signed in to change notification settings

cisco-ie/rrule-to-webex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rrule-to-webex Build Status Coverage Status Stellaris Module

Converts iCalendar RFC-5545 recurrence rule to Cisco's WebEx XML <repeat> XML sub tree

This module uses RRule.js to process iCalendar RFC RRule strings, therefore it also supports the ability to create <repeat> trees with RRule.js's objects. It's recommended to please go over the documentation to understand some of the differences between iCalendar RFC.

Install

$ npm install --save rrule-to-webex

Usage

const convert = require('rrule-to-webex');

const RFCString = "FREQ=WEEKLY;INTERVAL=5;UNTIL=20130130T230000Z;BYDAY=MO,FR";

convert(RFCString);
// === Output ===
// <repeat>
//    <repeatType>WEEKLY</repeatType>
//    <interval>5</interval>
//    <expirationDate>01/30/2013 17:00:00</expirationDate>
//    <dayInWeek>
//      <day>MONDAY</day>
//      <day>FRIDAY</day>
//    </dayInWeek>
// </repeat>

Supported RFC Reccur Parts

WebEx only supports a subset of the available (RFC iCalendar Recurrence parts](https://tools.ietf.org/html/rfc5545#section-3.3.10), this module attempts to map the available properties as defined in the repeat schema below to their iCalendar counter parts.

Repeat Schema

Caveats:

  • dayInYear is deprecated, thus is not supported by this module

API

rruleToWebEx(RRule)

Returns a XML tree defined by the WebEx repeat schema.

RRule

Type: string (iCalendar RFC String) || object (RRule.js Object)

The iCalendar String or RRule.js object to be converted

Specific Methods

rrule-to-webex also provides access to particular RRule conversion methods for custom uses and individual part conversion.

.freq(frequencyTypes)

frequencyTypes

Type: RRule.[WEEKlY, DAILY, MONTHLY, YEARLY]

.count(number)

number

Type: number
Range: 1 ... 999

.interval(number)

number

Type: number
Range: 1 .. 99

.byweekday(weekday)

weekday

Type: RRule.[MO, TU, WE, TH, FR, SA]
Range: 1 .. 99

.bymonthday(number)

number

Type: number
Range: 1 .. 99

.until(date)

date

Uses moment.js to parse date strings

Type: date object || date string (ISO 8601, RFC 2822, new Date(dateString))

Related

If you found this client useful, don't forget to star this repository and check other related open-source Cisco modules by the Innovation Edge team:

  • webex-api-client - A node module to simplify interacting with Cisco WebEx XML-based APIs from the browser or server
  • cisco-tp-client - A node API client to ease interactions with Cisco WebEx Telepresence-enabled endpoints / codecs
  • webex-time-zones - 🌐 An enumerated list of Cisco WebEx supported time zones
  • webex-date - 🕰 Convert a JavaScript date type, RFC 2822, ISO-8601 to the WebEx XML API supported format.
  • webex-enum-types - 🍭 A JSON mapping of enumerated types for Cisco's WebEx XML API

License

MIT © Cisco Innovation Edge

About

Converts a RRULE (iCalendar RFC-5545) to Cisco's WebEx recurrence repeat XML tree

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published