<commit_before>rrecurjs
=======

Convert between RFC2445 RRULE and its JSON equivalent. Useful with rrule.js.

You put in an object like this:

```json
{ "freq": "weekly"
, "until": "2015-01-01T10:30:00.000Z"
, "byday": ["tu", "th"]
, "byhour": [4]
, "byminute": [30]
}
```

And you get 

https://github.com/jkbr/rrule#api

Installation
===

### browser

**NOTE**: you only need `rrecur.js` for the basic `JSON <-> RRULE` conversion.
If you want to actually find the occurances you'll need
`underscore.js`, `rrule.js`, and `moment.js`, and `rrecur-iterator.js`.
However, in some future version I may be able to eliminate `underscore.js` and `rrule.js`.

via bower

```bash
bower install rrecur
```

via download

```bash
wget https://raw2.github.com/coolaj86/rrecurjs/master/rrecur.js
wget https://raw2.github.com/coolaj86/rrecurjs/master/rrecur-iterator.js
```

and insert the script tag, of course

```html
<script src="underscore.js"></script>
<script src="rrule.js"></script>
<script src="moment.js"></script>
<script src="rrecur.js"></script>
<script src="rrecur-iterator.js"></script>
```

```jade
script(src="underscore.js")
script(src="rrule.js")
script(src="moment.js")
script(src="rrecur.js")
script(src="rrecur-iterator.js")
```

I know, it's a lot of dependencies... but that's just how it is.
In a future version it may be reasonable to drop `underscore` and `rrule`,
but `moment` is a must. JavaScript's Date object is just too messed up.


### node.js

```bash
npm install rrecur
```

### Usage

This snippet will work both in the Browser and with Node.js
(hence the scary bit at the bottom).

```javascript
(function (exports) {
  'use strict';

  var Rrecur = require('rrecur').Rrecur
    , rfcString
    , rruleObj
    ;

  rruleObj = Rrecur.parse('FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU');

  rfcString = Rrecur.stringify({
    "freq": "monthly"
  , "interval": "2"
  , "count": "10"
  , "byday": ["1su","-1su"]
  });

}('undefined' !== typeof exports && exports || new Function('return this')()));
```

What'chu talkin' 'bout, Willis?
---

Recurring events, that's what Willis was talking about.

If you want UIs like these:

Google Calendar: http://imgur.com/a/gT7Af

Thunderbird Calendar: http://imgur.com/a/LhnWU

Kendo Calendar: http://imgur.com/a/zVLyg

You need a library like this to actually interpret the data.
<commit_msg>update README to include next/previous<commit_after>rrecurjs
=======

Convert between RFC2445 RRULE and its JSON equivalent.

Also tells the previous or next occurence of an event in an rrule chain.

Useful with `rrule.js`.

API
---

* `Rrecur.parse(rruleStr)` - parses a string rrule (allows non-standard `dtstart` in string)
* `Rrecur.stringify(rruleObj)` - stringifies an rrule object (allows non-standard `dtstart`)
* `Rrecur.create(rrule)` - creates a wrapped instance from `rrule.js` from an rrule object or string
  * `Rrecur#previous()` - cycles backwards through time to find a previous instance up to `dtstart`
  * `Rrecur#next()` - cycles forwards through time to find the next instance up to `until` or `count`

You put in an object like this:

```json
{ "freq": "weekly"
, "until": "2015-01-01T10:30:00.000Z"
, "byday": ["tu", "th"]
, "byhour": [4]
, "byminute": [30]
}
```

And you get 

https://github.com/jkbr/rrule#api

Installation
===

### browser

**NOTE**: you only need `rrecur.js` for the basic `JSON <-> RRULE` conversion.
If you want to actually find the occurances you'll need
`underscore.js`, `rrule.js`, and `moment.js`, and `rrecur-iterator.js`.
However, in some future version I may be able to eliminate `underscore.js` and `rrule.js`.

via bower

```bash
bower install rrecur
```

via download

```bash
wget https://raw2.github.com/coolaj86/rrecurjs/master/rrecur.js
wget https://raw2.github.com/coolaj86/rrecurjs/master/rrecur-iterator.js
```

and insert the script tag, of course

```html
<script src="underscore.js"></script>
<script src="rrule.js"></script>
<script src="moment.js"></script>
<script src="rrecur.js"></script>
<script src="rrecur-iterator.js"></script>
```

```jade
script(src="underscore.js")
script(src="rrule.js")
script(src="moment.js")
script(src="rrecur.js")
script(src="rrecur-iterator.js")
```

I know, it's a lot of dependencies... but that's just how it is.
In a future version it may be reasonable to drop `underscore` and `rrule`,
but `moment` is a must. JavaScript's Date object is just too messed up.


### node.js

```bash
npm install rrecur
```

### Usage

This snippet will work both in the Browser and with Node.js
(hence the scary bit at the bottom).

```javascript
(function (exports) {
  'use strict';

  var Rrecur = exports.Rrecur || require('rrecur').Rrecur
    , rfcString
    , rruleObj
    ;

  rruleObj = Rrecur.parse('FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU');

  rfcString = Rrecur.stringify({
    "freq": "monthly"
  , "interval": "2"
  , "count": "10"
  , "byday": ["1su","-1su"]
  });

}('undefined' !== typeof exports && exports || new Function('return this')()));
```

What'chu talkin' 'bout, Willis?
---

Recurring events, that's what Willis was talking about.

If you want UIs like these:

Google Calendar: http://imgur.com/a/gT7Af

Thunderbird Calendar: http://imgur.com/a/LhnWU

Kendo Calendar: http://imgur.com/a/zVLyg

You need a library like this to actually interpret the data.

{'fraction_non_alphanumeric': 0.16139299756599887, 'fraction_numerical': 0.015352930162890844, 'mean_word_length': 4.379657603222558, 'pattern_counts': {'":': 18, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '35481', 'n_tokens_mistral': 2023, 'n_tokens_neox': 1884, 'n_words': 569}