Skip to content

Commit

Permalink
build/ical.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sunesimonsen committed May 27, 2015
1 parent e7f1834 commit ef4cf4c
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions build/ical.js
Original file line number Diff line number Diff line change
Expand Up @@ -6684,10 +6684,7 @@ ICAL.RecurIterator = (function() {
this.increment_year(this.rule.interval);
}

var next = ICAL.Time.fromDayOfYear(this.days[0], this.last.year);

this.last.day = next.day;
this.last.month = next.month;
this._nextByYearDay();
}

if (this.rule.freq == "MONTHLY" && this.has_by_data("BYDAY")) {
Expand Down Expand Up @@ -7247,15 +7244,27 @@ ICAL.RecurIterator = (function() {
} while (this.days.length == 0);
}

var next = ICAL.Time.fromDayOfYear(this.days[this.days_index],
this.last.year);

this.last.day = next.day;
this.last.month = next.month;
this._nextByYearDay();

return 1;
},

_nextByYearDay: function _nextByYearDay() {
var doy = this.days[this.days_index];
var year = this.last.year;
if (doy < 1) {
// Time.fromDayOfYear(doy, year) indexes relative to the
// start of the given year. That is different from the
// semantics of BYYEARDAY where negative indexes are an
// offset from the end of the given year.
doy += 1;
year += 1;
}
var next = ICAL.Time.fromDayOfYear(doy, year);
this.last.day = next.day;
this.last.month = next.month;
},

ruleDayOfWeek: function ruleDayOfWeek(dow) {
var matches = dow.match(/([+-]?[0-9])?(MO|TU|WE|TH|FR|SA|SU)/);
if (matches) {
Expand Down

0 comments on commit ef4cf4c

Please sign in to comment.