Skip to content

Commit

Permalink
Merge pull request #415 from tbjgolden/master
Browse files Browse the repository at this point in the history
fix: typo plural minutes
  • Loading branch information
jkbrzt authored Aug 21, 2020
2 parents a96ba52 + ab9c564 commit 07580aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/nlp/totext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export default class ToText {
this.add(
this.plural(this.options.interval!)
? gettext('minutes')
: gettext('minutes')
: gettext('minute')
)
}

Expand Down
12 changes: 12 additions & 0 deletions test/nlp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 07580aa

Please sign in to comment.