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.29k stars 514 forks source link

rrule feature request: flag called 'includeshortmonths' that works in coordination with 'bymonthday' #525

Open mkruglyak opened 2 years ago

mkruglyak commented 2 years ago

rrule feature request: flag called 'includeshortmonths' that works in coordination with 'bymonthday', as demonstrated by these examples:

e.g. bymonthday=31 includeshortmonths=True returns Jan 31 2021, Feb 28 2021, Mar 31 2021, Apr 30 2021... Note: result can be obtained with bymonthday=-1

e.g. bymonthday=30 includeshortmonths=True returns Jan 30 2021, Feb 28 2021, Mar 30 2021, Apr 30 2021...

e.g. bymonthday=29 includeshortmonths=True returns Jan 29 2021, Feb 28 2021, Mar 29 2021, Apr 29 2021...

Currently, setting bymonthday=30 will omit the month of Feb. Same with bymonthday=29 for non-leap years.

allenm commented 1 year ago

You can use

{
  "bymonthday": [31, -1],
  "bysetpos": [1]
}

to achieve this purpose.

agos commented 1 year ago

I think this could be better documented - it's a common use case and the behaviour of bysetpos is not very clear