jkbrzt / rrule

JavaScript library for working with recurrence rules for calendar dates as defined in the iCalendar RFC and more.
https://jkbrzt.github.io/rrule
Other
3.24k stars 506 forks source link

RRuleSet toString() get a string result, but parse this string result can not restore previous RRuleSet, the time is not right #582

Open elsonwx opened 1 year ago

elsonwx commented 1 year ago
const rruleSet = new RRuleSet()
// Add a rrule to rruleSet
rruleSet.rrule(
  new RRule({
    freq: RRule.MONTHLY,
    count: 5,
    dtstart: datetime(2012, 2, 1, 10, 30),
  })
)
rruleSet.rrule(
    new RRule({
      freq: RRule.MONTHLY,
      count: 6,
      dtstart: datetime(2012, 3, 1, 10, 30),
    })
)
const str1 = rruleSet.toString()
const str2 = rrulestr(str1).toString()
console.log(str1)
console.log(str2)

the difference is below.

image

maf1a commented 8 months ago

having the same issue