rrule icon indicating copy to clipboard operation
rrule copied to clipboard

rule.toText() to respect BYSETPOS

Open Primajin opened this issue 4 years ago • 2 comments

Reporting an issue

Thank you for taking an interest in rrule! Please include the following in your report:

  • [x] Verify that you've looked through existing issues for duplicates before creating a new one Edit: later i found #75
  • [x] Code sample reproducing the issue. Be sure to include all input values you are using such as the exact RRule string and dates.
  • [x] Expected output RRULE:FREQ=MONTHLY;INTERVAL=1;WKST=MO;BYDAY=SU;BYSETPOS=2 --> every month on the second Sunday RRULE:FREQ=MONTHLY;INTERVAL=1;WKST=MO;BYDAY=SU;BYSETPOS=-1 --> every month on the last Sunday Screenshot 2020-11-11 at 17 39 45
    (Google Calendar)
  • [x] Actual output RRULE:FREQ=MONTHLY;INTERVAL=1;WKST=MO;BYDAY=SU;BYSETPOS=2 --> every month on Sunday RRULE:FREQ=MONTHLY;INTERVAL=1;WKST=MO;BYDAY=SU;BYSETPOS=-1 --> every month on Sunday

Screenshot 2020-11-11 at 17 49 59 Screenshot 2020-11-11 at 17 49 23

  • [x] The version of rrule you are using Online http://jakubroztocil.github.io/rrule/ --> I guess that is latest
  • [x] Your operating system Chrome Version 88.0.4322.0 (Official Build) canary (x86_64) on MacOSX
  • [x] Your local timezone (run $ date from the command line of the machine showing the bug) CET (Central European Time)

Primajin avatar Nov 11 '20 16:11 Primajin

Any news on this item ?

JoopStringer avatar Jan 28 '22 10:01 JoopStringer

+1 Quote from the Docs: "For example, with RRule.MONTHLY, or with RRule.YEARLY and BYMONTH, using RRule.FR.nth(+1) or RRule.FR.nth(-1) in byweekday will specify the first or last friday of the month where the recurrence happens."

If set up in this way, the toText() returns the correct string (e.g. "Every fourth [..]", "Last Friday every [...]"). But this is really uncomfortable to implement, also it's definitely not the expected behavior...

lihsit-robinexner avatar Feb 09 '22 12:02 lihsit-robinexner