GithubHelp home page GithubHelp logo

cisco-ie / rrule-to-webex Goto Github PK

View Code? Open in Web Editor NEW
3.0 6.0 0.0 22 KB

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

License: MIT License

JavaScript 100.00%
cisco-collaboration cisco-webex stellaris rfc-5545 webex cisco

rrule-to-webex's Introduction

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

rrule-to-webex's People

Contributors

brh55 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rrule-to-webex's Issues

Matches for WebEx

Just to discuss and try to do the matching ahead of time:

RFC-5545 for Recurrence: https://tools.ietf.org/html/rfc5545#section-3.3.10

recur-rule-part = ( "FREQ" "=" freq )
                       / ( "UNTIL" "=" enddate )
                       / ( "COUNT" "=" 1*DIGIT )
                       / ( "INTERVAL" "=" 1*DIGIT )
                       / ( "BYSECOND" "=" byseclist )
                       / ( "BYMINUTE" "=" byminlist )
                       / ( "BYHOUR" "=" byhrlist )
                       / ( "BYDAY" "=" bywdaylist )
                       / ( "BYMONTHDAY" "=" bymodaylist )
                       / ( "BYYEARDAY" "=" byyrdaylist )
                       / ( "BYWEEKNO" "=" bywknolist )
                       / ( "BYMONTH" "=" bymolist )
                       / ( "BYSETPOS" "=" bysplist )
                       / ( "WKST" "=" weekday )

WebEx

image

  • repeatType - [DAILY, WEEKLY, NO_REPEAT, MONTHLY, YEARLY and CONSTANT]
  • interval - [1 ... 99]
  • afterMeetingNumber - [0 ... 999]
  • dayInWeek - - [SUNDAY, MONDAY, TUESDAY, WEDNESDAY,THURSDAY, FRIDAY, and SATURDAY
  • expirationDate - MM/DD/YY HH:MM:SS
  • dayInMonth - [1 ... 31]
  • weekInMonth - [1 ... 5]
  • monthInYear - [1... 12]
  • [?] dayInYear - DEPRECATED

Conversion List iCAL -> WebEx

Unchecked are not supported by WebEx

  • FREQ ("SECONDLY" / "MINUTELY" / "HOURLY" / "DAILY" / "WEEKLY" / "MONTHLY" / "YEARLY") -> <repeatType></repeatType>
  • UNTIL (19980118T230000) -> <expirationDate>MM/DD/YY HH:MM:SS</expirationDate>
  • COUNT -> <afterMeetingNumber>value</afterMeetingNumber>
  • INTERVAL -> <interval>value</interval>
  • BYSECOND -> N/A
  • BYMINUTE -> N/A
  • BYHOUR -> N/A
  • BYDAY -> <dayInWeek><day></day></dayInWeek>
  • BYMONTHDAY -> <dayInMonthy>[1 ... 31]<dayInMonth>
  • BYYEARDAY -> WEBEX DEPRECATED <dayInYear>
  • BYWEEKNO -> <weekInMonth>[1 ... 5]</weekInMonth>
  • BYMONTH -> <monthInYear><monthInYear>
  • BYSETPOS -> <bySetPosition>value</bySetPosition>
  • WKST ->

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.