Don't change the day of the month to 28, if it is > 28

Gosh. The logic was saying, if the modified date has a day of the
month > 28, change it to 28. Which is rather odd. Don't do that.

This closes #248. It also fixes a bug with FREQ=MONTHLY;BYMONTHDAY=-1
as it turns out.
This commit is contained in:
Andrew Ruthven authored and Andrew Ruthven committed 2022-12-18 13:52:48 +13:00
1 parent 6e68c221e9
commit a323ba8dae
2 files changed
+9 -12

No files matched your search

@@ -258,17 +258,17 @@ SQL Result:
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
20110831 - RRULE:FREQ=MONTHLY;BYMONTHDAY=-1
The last day of each month
PHP & SQL results are identical (-:
PHP & SQL results differ :-(
PHP Result:
2011-08-31 00:00:00 2011-09-30 00:00:00 2011-10-31 00:00:00 2011-11-30 00:00:00
2011-12-31 00:00:00 2012-01-31 00:00:00 2012-02-29 00:00:00 2012-03-31 00:00:00
2012-04-30 00:00:00 2012-05-31 00:00:00 2012-06-30 00:00:00 2012-07-31 00:00:00
2012-08-31 00:00:00 2012-09-30 00:00:00 2012-10-31 00:00:00 2012-11-30 00:00:00
2012-12-31 00:00:00 2013-01-31 00:00:00 2013-02-28 00:00:00 2013-03-31 00:00:00
2013-04-30 00:00:00 2013-05-31 00:00:00 2013-06-30 00:00:00 2013-07-31 00:00:00
2013-08-31 00:00:00 2013-09-30 00:00:00 2013-10-31 00:00:00 2013-11-30 00:00:00
2013-12-31 00:00:00 2014-01-31 00:00:00
2011-08-31 00:00:00 2011-10-31 00:00:00 2011-11-30 00:00:00 2011-12-31 00:00:00
2012-01-31 00:00:00 2012-02-29 00:00:00 2012-03-31 00:00:00 2012-04-30 00:00:00
2012-05-31 00:00:00 2012-06-30 00:00:00 2012-07-31 00:00:00 2012-08-31 00:00:00
2012-09-30 00:00:00 2012-10-31 00:00:00 2012-11-30 00:00:00 2012-12-31 00:00:00
2013-01-31 00:00:00 2013-02-28 00:00:00 2013-03-31 00:00:00 2013-04-30 00:00:00
2013-05-31 00:00:00 2013-06-30 00:00:00 2013-07-31 00:00:00 2013-08-31 00:00:00
2013-09-30 00:00:00 2013-10-31 00:00:00 2013-11-30 00:00:00 2013-12-31 00:00:00
2014-01-31 00:00:00 2014-02-28 00:00:00
SQL Result: