Skip to content

Commit

Permalink
comment out broken month handling code
Browse files Browse the repository at this point in the history
  • Loading branch information
LorienHW committed Jun 28, 2018
1 parent 16e9cf1 commit 750249f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/recurring.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function RecurringDate (pattern, date_format) {
if (isNaN(parseInt(pattern.every))) {
throw new TypeError('Every magnitude must be a valid number');
}

this.pattern = pattern;

// stores generated dates based on recurrence pattern
Expand Down Expand Up @@ -93,7 +93,7 @@ RecurringDate.prototype.describe = function () {

t.push('starting on', this.start.toString(this.date_format));

if (this.end_condition == 'until') {
if (this.end_condition == 'until') {
t.push('until', this._getDate(this.until).format(this.date_format));
} else if (this.end_condition == 'for') {
t.push('for', this.rfor, 'occurrences');
Expand All @@ -108,7 +108,7 @@ RecurringDate.prototype.contains = function (d) {

// can be string or date object already
d = this._getDate(d);

for (var i = 0; i < this.dates.length; i++) {
if (d.diff(this.dates[i], 'days') === 0) return true;
}
Expand Down Expand Up @@ -149,8 +149,8 @@ RecurringDate.prototype.generate = function (max) {
// scan through the checked days
for (var i in this.days) {
var d = this.days[i];
if (curr.day() < d) curr.day(d);

if (curr.day() < d) curr.day(d);
if (curr <= this.start) continue;
if (end_condition_reached(dates, curr)) continue;

Expand All @@ -165,11 +165,11 @@ RecurringDate.prototype.generate = function (max) {

} else if (this.unit == 'm') {
while (true) {
if (this.occurrence_of == -1) {
curr.date(-1);
} else {
curr.moveToNthOccurrence(this.occurrence_of, this.nth);
}
// if (this.occurrence_of == -1) {
// curr.date(-1);
// } else {
// curr.moveToNthOccurrence(this.occurrence_of, this.nth);
// }

if (end_condition_reached(dates, curr)) break;

Expand Down Expand Up @@ -200,4 +200,4 @@ RecurringDate.prototype.generate = function (max) {
return this.dates;
}

module.exports = RecurringDate;
module.exports = RecurringDate;

0 comments on commit 750249f

Please sign in to comment.