diff --git a/src/nlp/totext.ts b/src/nlp/totext.ts index fa73b838..f58e269d 100644 --- a/src/nlp/totext.ts +++ b/src/nlp/totext.ts @@ -192,7 +192,7 @@ export default class ToText { this.add( this.plural(this.options.interval!) ? gettext('minutes') - : gettext('minutes') + : gettext('minute') ) } diff --git a/test/nlp.test.ts b/test/nlp.test.ts index 540912cd..d53c6785 100644 --- a/test/nlp.test.ts +++ b/test/nlp.test.ts @@ -79,6 +79,18 @@ describe('NLP', () => { expect(rule.toText()).to.equal('every day') }) + it('shows correct text for every minute', () => { + const options = { 'freq': RRule.MINUTELY }; + const rule = new RRule(options); + expect(rule.toText()).to.equal('every minute'); + }); + + it('shows correct text for every (plural) minutes', () => { + const options = { 'freq': RRule.MINUTELY, 'interval': 2 }; + const rule = new RRule(options); + expect(rule.toText()).to.equal('every 2 minutes'); + }); + it('by default formats \'until\' correctly', () => { const rrule = new RRule({ freq: RRule.WEEKLY,