diff --git a/src/nlp/totext.ts b/src/nlp/totext.ts index cbb614a1..4899ba0f 100644 --- a/src/nlp/totext.ts +++ b/src/nlp/totext.ts @@ -139,7 +139,7 @@ export default class ToText { if (rrule.origOptions.until && rrule.origOptions.count) return false for (const key in rrule.origOptions) { - if (contains(['dtstart', 'wkst', 'freq'], key)) return true + if (contains(['dtstart', 'tzid', 'wkst', 'freq'], key)) return true if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key)) return false } diff --git a/test/nlp.test.ts b/test/nlp.test.ts index c64e7b44..c7c491c7 100644 --- a/test/nlp.test.ts +++ b/test/nlp.test.ts @@ -29,6 +29,11 @@ const texts = [ ['Every week for 20 times', 'RRULE:FREQ=WEEKLY;COUNT=20'], ] +const toTexts = [ + ...texts, + ['Every week on monday', 'DTSTART;TZID=America/New_York:20220601T000000\nRRULE:INTERVAL=1;FREQ=WEEKLY;BYDAY=MO'], +] + describe('NLP', () => { it('fromText()', function () { texts.forEach(function (item) { @@ -39,7 +44,7 @@ describe('NLP', () => { }) it('toText()', function () { - texts.forEach(function (item) { + toTexts.forEach(function (item) { const text = item[0] const str = item[1] expect(RRule.fromString(str).toText().toLowerCase()).equals(