diff --git a/lib/nlp.js b/lib/nlp.js index 5da1ac0f..9e1c3097 100644 --- a/lib/nlp.js +++ b/lib/nlp.js @@ -119,6 +119,7 @@ ] ToText.IMPLEMENTED = [] ToText.IMPLEMENTED[RRule.HOURLY] = common + ToText.IMPLEMENTED[RRule.MINUTELY] = common ToText.IMPLEMENTED[RRule.DAILY] = ['byhour'].concat(common) ToText.IMPLEMENTED[RRule.WEEKLY] = common ToText.IMPLEMENTED[RRule.MONTHLY] = common @@ -193,6 +194,15 @@ ? gettext('hours') : gettext('hour')) }, + MINUTELY: function () { + var gettext = this.gettext + + if (this.options.interval !== 1) this.add(this.options.interval) + + this.add(this.plural(this.options.interval) + ? gettext('minutes') : gettext('minutes')) + }, + DAILY: function () { var gettext = this.gettext @@ -324,7 +334,7 @@ this.add(gettext('on the')) .add(this.list(this.bymonthday, this.nth, gettext('and'))) } - // this.add(gettext('DAY')) + // this.add(gettext('DAY')) }, _byweekday: function () { @@ -570,6 +580,14 @@ } break + case 'minute(s)': + options.freq = RRule.MINUTELY + if (ttr.nextSymbol()) { + ON() + F() + } + break + case 'month(s)': options.freq = RRule.MONTHLY if (ttr.nextSymbol()) { @@ -938,6 +956,7 @@ 'weekday(s)': /^weekdays?/i, 'week(s)': /^weeks?/i, 'hour(s)': /^hours?/i, + 'minute(s)': /^minutes?/i, 'month(s)': /^months?/i, 'year(s)': /^years?/i, 'on': /^(on|in)/i,