rrecur.js
function parse(str) {
    str = str.replace(/\n/, ';');
    str = str.replace(/RRULE:/, '');
    str = str.replace(/DTSTART;/, 'DTSTART__SEMI__');
    var pairs = str.split(';')
      , obj = {}
      ;

    pairs.forEach(function (pair) {
      pair = pair.replace(/DTSTART__SEMI__/, 'DTSTART;');
      var parts = pair.split('=')
        , k = parts[0]
        , ks
        , param
        , tzid
        , vstr = parts[1]
        , v
        ;

      // Handle case of DTSTART;TZID=US-Eastern:{{yyyymmddThhmmss}} // NO Z ALLOWED
      ks = k.split(';');
      k = ks[0];

      // TZID exists
      if ('TZID' === ks[1]) {
        param = ks[1].split(':');
        tzid = param[0];
        obj.tzid = tzid;
        v = param[1];
      }

      // Handle case of DTSTART;LOCALE=GMT-0600 (MDT):{{yyyymmddThhmmss}} // NO Z ALLOWED
      // obj.locale = obj.locale || stringifyGmtZone(obj.dtstart);
      if ('LOCALE' === ks[1]) {
        if (localeWarn2) {
          console.warn('[parse] falling back to non-standard locale definition for timezone');
          localeWarn2 = false;
        }
        param = vstr.split(':');
        obj.locale = param[0];

        // Continue with DTSTART
        k = ks[0];
        vstr = v = param[1];
      }

      switch (k) {
      case 'DTSTART':
      case 'UNTIL':
        v = Rrecur.toRruleDateString(vstr);
        break;
      case 'FREQ':
      case 'WKST':
        v = vstr.toLowerCase();
        break;
      case 'INTERVAL':
      case 'COUNT':
        v = vstr;
        break;
      case 'BYWEEKDAY':
        console.warn('converting rrule.js BYWEEKDAY to rrule rfc BYDAY');
        k = 'BYDAY';
        /* fall through */
      case 'BYSETPOS':
      case 'BYYEARDAY':
      case 'BYMONTH':
      case 'BYWEEKNO':
      case 'BYDAY':
      case 'BYMONTHDAY':
      case 'BYHOUR':
      case 'BYMINUTE':
      case 'BYSECOND':
      case 'BYEASTER':
        v = vstr.split(',');
        v.forEach(function (val, i) {
          v[i] = val.toLowerCase();
        });
        break;
      }

      obj[k.toLowerCase()] = v;
    });

    return obj;
  }
function parse(str) {
    str = str.replace(/\n/, ';');
    str = str.replace(/RRULE:/, '');
    str = str.replace(/DTSTART;/, 'DTSTART__SEMI__');
    var pairs = str.split(';')
      , obj = {}
      ;

    pairs.forEach(function (pair) {
      pair = pair.replace(/DTSTART__SEMI__/, 'DTSTART;');
      var parts = pair.split('=')
        , k = parts[0]
        , ks
        , param
        , tzid
        , vstr = parts[1]
        , v
        ;

      // Handle case of DTSTART;TZID=US-Eastern:{{yyyymmddThhmmss}} // NO Z ALLOWED
      ks = k.split(';');
      k = ks[0];

      // TZID exists
      if ('TZID' === ks[1]) {
        param = ks[1].split(':');
        tzid = param[0];
        obj.tzid = tzid;
        v = param[1];
      }

      // Handle case of DTSTART;LOCALE=GMT-0600 (MDT):{{yyyymmddThhmmss}} // NO Z ALLOWED
      // obj.locale = obj.locale || stringifyGmtZone(obj.dtstart);
      if ('LOCALE' === ks[1]) {
        if (localeWarn2) {
          console.warn('[parse] falling back to non-standard locale definition for timezone');
          localeWarn2 = false;
        }
        param = vstr.split(':');
        obj.locale = param[0];

        // Continue with DTSTART
        k = ks[0];
        vstr = v = param[1];
      }

      switch (k) {
      case 'DTSTART':
      case 'UNTIL':
        v = Rrecur.toRruleDateString(vstr);
        break;
      case 'FREQ':
      case 'WKST':
        v = vstr.toLowerCase();
        break;
      case 'INTERVAL':
      case 'COUNT':
        v = vstr;
        break;
      case 'BYWEEKDAY':
        console.warn('converting rrule.js BYWEEKDAY to rrule rfc BYDAY');
        k = 'BYDAY';
        /* fall through */
      case 'BYSETPOS':
      case 'BYYEARDAY':
      case 'BYMONTH':
      case 'BYWEEKNO':
      case 'BYDAY':
      case 'BYMONTHDAY':
      case 'BYHOUR':
      case 'BYMINUTE':
      case 'BYSECOND':
      case 'BYEASTER':
        v = vstr.split(',');
        v.forEach(function (val, i) {
          v[i] = val.toLowerCase();
        });
        break;
      }

      obj[k.toLowerCase()] = v;
    });

    return obj;
  }
function parse ( str ) { str = str . replace ( / \n / , ';' ) ; str = str . replace ( / RRULE: / , '' ) ; str = str . replace ( / DTSTART; / , 'DTSTART__SEMI__' ) ; var pairs = str . split ( ';' ) , obj = { } ; pairs . forEach ( function ( pair ) { pair = pair . replace ( / DTSTART__SEMI__ / , 'DTSTART;' ) ; var parts = pair . split ( '=' ) , k = parts [ 0 ] , ks , param , tzid , vstr = parts [ 1 ] , v ; // Handle case of DTSTART;TZID=US-Eastern:{{yyyymmddThhmmss}} // NO Z ALLOWED ks = k . split ( ';' ) ; k = ks [ 0 ] ; // TZID exists if ( 'TZID' === ks [ 1 ] ) { param = ks [ 1 ] . split ( ':' ) ; tzid = param [ 0 ] ; obj . tzid = tzid ; v = param [ 1 ] ; } // Handle case of DTSTART;LOCALE=GMT-0600 (MDT):{{yyyymmddThhmmss}} // NO Z ALLOWED // obj.locale = obj.locale || stringifyGmtZone(obj.dtstart); if ( 'LOCALE' === ks [ 1 ] ) { if ( localeWarn2 ) { console . warn ( '[parse] falling back to non-standard locale definition for timezone' ) ; localeWarn2 = false ; } param = vstr . split ( ':' ) ; obj . locale = param [ 0 ] ; // Continue with DTSTART k = ks [ 0 ] ; vstr = v = param [ 1 ] ; } switch ( k ) { case 'DTSTART' : case 'UNTIL' : v = Rrecur . toRruleDateString ( vstr ) ; break ; case 'FREQ' : case 'WKST' : v = vstr . toLowerCase ( ) ; break ; case 'INTERVAL' : case 'COUNT' : v = vstr ; break ; case 'BYWEEKDAY' : console . warn ( 'converting rrule.js BYWEEKDAY to rrule rfc BYDAY' ) ; k = 'BYDAY' ; /* fall through */ case 'BYSETPOS' : case 'BYYEARDAY' : case 'BYMONTH' : case 'BYWEEKNO' : case 'BYDAY' : case 'BYMONTHDAY' : case 'BYHOUR' : case 'BYMINUTE' : case 'BYSECOND' : case 'BYEASTER' : v = vstr . split ( ',' ) ; v . forEach ( function ( val , i ) { v [ i ] = val . toLowerCase ( ) ; } ) ; break ; } obj [ k . toLowerCase ( ) ] = v ; } ) ; return obj ; }
DTSTART is not part of RRULE
DTSTART is not part of RRULE