Skip to content

Commit

Permalink
Merge branch 'master' into feature/timezone
Browse files Browse the repository at this point in the history
* master:
  Renamed isValid() to isValidDate().
  Undo jkbrzt#91 as it was breaking the demo app
  Allow Negative and 2-Digit Values in Demo
  Bugfix
  Updating script location in Bower, fixes jkbrzt#61.

Conflicts:
	bower.json
	lib/rrule.js
  • Loading branch information
aramk committed May 3, 2015
2 parents 808e058 + 268970b commit b21afa3
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 82 deletions.
68 changes: 33 additions & 35 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
{
"name": "rrule",
"description": "JavaScript library for working with recurrence rules for calendar dates.",
"homepage": "http://jakubroztocil.github.io/rrule/",
"keywords": [
"dates",
"recurrences",
"calendar",
"icalendar",
"rfc"
],
"repository": {
"type": "git",
"url": "git://github.com/jakubroztocil/rrule.git"
},
"version": "2.1.0",
"authors": [
{
"name": "Jakub Roztočil",
"homepage": "http://subtleapps.com/"
"name": "rrule",
"description": "JavaScript library for working with recurrence rules for calendar dates.",
"homepage": "http://jakubroztocil.github.io/rrule/",
"keywords": [
"dates",
"recurrences",
"calendar",
"icalendar",
"rfc"
],
"repository": {
"type": "git",
"url": "git://github.com/jakubroztocil/rrule.git"
},
{
"name": "Lars Schöning"
"version": "2.1.0",
"authors": [
{
"name": "Jakub Roztočil",
"homepage": "http://subtleapps.com/"
},
{
"name": "Lars Schöning"
}
],
"main": "lib/rrule.js",
"ignore": [
"**/.*",
"node_modules",
"components"
],
"devDependencies": {
"underscore": "~1.8.3",
"moment-timezone": "~0.3.1",
"tz-date": "https://github.com/aramk/tz-date.git"
}
],
"main": "rrule.js",
"ignore": [
"**/.*",
"node_modules",
"components"
],
"devDependencies": {
"underscore": "~1.8.3",
"moment-timezone": "~0.3.1"
},
"dependencies": {
"tz-date": "https://github.com/aramk/tz-date.git"
}
}
10 changes: 5 additions & 5 deletions lib/rrule.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ var dateutil = {
return date instanceof Date;
},

isValid: function(date) {
isValidDate: function (date) {
return this.isDate(date) && !isNaN(date.getTime());
},

Expand Down Expand Up @@ -765,8 +765,8 @@ RRule.DEFAULT_OPTIONS = {
interval: 1,
timezone: null,
wkst: RRule.MO,
count: null,
until: null,
count: null,
until: null,
bysetpos: null,
bymonth: null,
bymonthday: null,
Expand Down Expand Up @@ -1871,10 +1871,10 @@ IterResult.prototype = {
var before = args.before;
var after = args.after;
// Fail on invalid dates to avoid infinite loops in iterators.
if (dateutil.isDate(before) && !dateutil.isValid(before)) {
if (dateutil.isDate(before) && !dateutil.isValidDate(before)) {
throw new Error('Invalid before date');
}
if (dateutil.isDate(after) && !dateutil.isValid(after)) {
if (dateutil.isDate(after) && !dateutil.isValidDate(after)) {
throw new Error('Invalid after date');
}

Expand Down
2 changes: 1 addition & 1 deletion tests/demo/demo.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ $ ->
else
value = getDay(value)
else if /^by/.test(key)
if not value instanceof Array
if not (value instanceof Array)
value = value.split(/[,\s]+/)
value = (v for v in value when v)
value = value.map (n) -> parseInt(n, 10)
Expand Down
70 changes: 29 additions & 41 deletions tests/demo/demo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b21afa3

Please sign in to comment.