How to set an event that occurs on the last day of every month, not just occure on 31 of each month on google calender - icalendar

How to set an event that occurs on the last day of every month,
not just occure on 31 of each month on google calender.

FREQ=MONTHLY;BYSETPOS=-1
A bit of googling brings up a few related examples. Try searching on 'ics last day of month' or 'ics recurrence rule' - there are lots of examples in the RFC5545 spec too.

Related

Why does SYSTEMTIME::wDayOfWeek begin with 0 for sunday?

Can anyone here tell me why the week begins at 0 for sunday with SYSTEM_TIME::wDayOfWeek ? Here in Germany the week begins at monday. But maybe I'm missing that for other cultures the week begins at sunday.
The modern calendar was sponsored by Pope Gregory XIII. So regardless of one's personal beliefs about religion, it's necessary to look at what the designers of the Gregorian calendar believed:
In Genesis, the creation takes six days followed by one day of rest. It doesn't actually matter whether those were literal days, because the follow-up commandment to rest on each seventh day was talking about a literal day. That seventh day on which to rest was called "Sabbath" by the Jews.
In the gospels, the time of week isn't left to the imagination. Perfume could not be applied to the body of the Messiah as he was buried (as it was a feast day) or on the next day (as it was a Sabbath), so the women arrived at the tomb on the morning following the Sabbath, and recorded that they found it empty and thereafter spoke to a resurrected Messiah.
In honor of these two events in which the designers of and early adherents to the Gregorian calendar deeply believed, they made a weekend out of (a) the Sabbath (our Saturday), which was by definition the seventh day of one week, and (b) the weekday corresponding to resurrection (our Sunday), which therefore had to be the first day of the next week.
And that's why, in the Gregorian calendar, the week starts on Sunday. This is the system followed in the USA where the majority of OS APIs were designed, including the Windows API.

RRULE for every other week except last week of month

I need an RRULE for every other Saturday except the last week of the month. I tried to create one with a weekly frequency, but didn't know how to apply an exception for the last week of the month:
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=SA
I also tried creating a rule with a monthly frequency, which allowed me to skip the last week of the month, but I didn't know how to make it every other week:
RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=SA;BYSETPOS=-2,-3,-4,-5
I looked through the specification, but I'm not seeing anything that makes this possible.
The secret to the solution here is that BYMONTHDAY can be negative like BYSETPOS. This allows one to exclude the last 7 days of each month even though the number of days in the month varies. Your DTSTART should be on a SATURDAY, so one doesn't really need the BYDAY=SA
This rrule works in google calendar (if DTSTART is on Saturday and generally for any every 2nd week but not the last week rule for any day of week specified by the DTSTART):
RRULE:FREQ=WEEKLY;INTERVAL=2;BYMONTHDAY=-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-31
See test calendar:
https://calendar.google.com/calendar/u/0?cid=ZXBwdWE4N2RwZm5xODVic3JydDJzaXFsY3NAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ
Spec: https://datatracker.ietf.org/doc/html/rfc2445#page-43
and
https://icalevents.com/2447-need-to-know-the-possible-combinations-for-repeating-dates-an-ical-cheatsheet/ for the expansion & contraction (limiting) rules & combinations

RRULE for the weekend including the first sunday of a month

We have a event every year on the weekend (Fr-Su) that includes the first Sunday of June. How would I create a iCalendar Event that expresses these three days (whole day events)?
Creating a rule for the first Sunday is easy. But for the Saturday and Friday, I did not succeed to create a rule that counts backwards (RFC 5545 says INTERVAL, COUNT must be positive]. Moreover I could not think of a different expression that would start from the Friday - it could be the last Friday of May, but also the first in June.
The RRRULE specification in RFC 5545 is lacking in this regard. The INTERVAL and COUNT values are for the repeating events, not the event itself. I've come across a similar issue when trying to define the USA day "Black Friday", the day after the 4th Thursday in November (Friday after Thanksgiving). The 4th Friday in November could occur the day after the 4th Thursday, or the prior week. There is not a way that I have found to make a RRULE for this situation.
I believe you will need to code the events individually instead of using a recurring rule.
RRULE:FREQ=YEARLY;BYDAY=FR;BYMONTH=5,6;BYSETPOS=2;BYMONTHDAY=-2,-1,1,2,3,4,5,6,7' seems to do the trick.
How can I write an ICS file for the Friday before the first Saturday of the month? led me to the right track: with 'BYMONTHDAY' I can count backwards from the end of the month.
The Friday before the first Sunday of the next month can be the last or the second to last day of the previous month, or up to the 5th day of the month. If I include May and June, I will get a set that includes the day. 'BYSETPOS' allows me to choose the second of the found Fridays. To always have the second in the set being my desired day, I include the 6th and 7th day of the month, which gives me a stable first Friday in May. Possibly matched additional Fridays in June are discarded by 'BYSETPOS' anyway.
Extending this to Saturday is simple, and the first Sunday of June is trivial.
I developed the rule with rrule.js
https://jakubroztocil.github.io/rrule/#/rfc/RRULE:BYDAY=FR;BYMONTH=5,6;BYSETPOS=2;BYMONTHDAY=-2,-1,1,2,3,4,5,6,7

PayMill subscription interval regularity

Simple questions, but I can't seem to find the answers in PayMill's API documentation or FAQ:
If a payment subscription is classed as monthly, does it poll for the funds every 30 days or on the anniversary of the month, i.e. set up on 15.4.2014, next payment 15.5.2014?
If it polls on the same date every month, what happens if the subscription was set up on the 31st of the month, i.e. on a date not present in February, April etc?
Thanks.
On the same date. If the interval is 1 MONTH and the first payment occurs on 15.4.2014 the next one will be on 15.5.2014. Note that you can also specify a weekday, in that case it will be the next weekday (e.g. Monday), either the 15.05.2014 (if it's a Monday) or the first Monday after 15.05.2014
It will probably be on the next day (1 March instead of the "missing 31 February". It will definitely not be skipped. If the exact behavior is crucial for your business, please contact the PAYMILL support to seek a definite answer.

Repeating end of the month events on iPhone Calendar, problem for February

This is more of an usability problem/bug/question.
I wanted to add an event to occur on the end of the month for every month.
But if I choose October 31 and set Repeat Event -> Every Month, all months ending in 30 are left out (including 28-feb).
So, I could solve this by putting the end of the month at 30, and only miss out on February... But I need it to be on the 31, when the month ends in 31; 30 when it ends in 30; and 28 or 29 for February.
The Calendar app doesn't detect that I want it "Every Month at the end of the month".
I can't create an event for 30 and another for 31 because I would have the same event twice on months ending in 31.
So, anyone have a way around this?
Of course, going to each month and setting it is not an answer I'm looking for. And requesting 28-day 13-month calendars isn't either.
Set the graphic calendar solution aside, and try something like:
Repeat event <Monthly> on <first> <Friday>
Repeat event <Monthly> on <last> <day>
Translate that to a programmatic schedule as needed.
I am frustrated by the same issue. Although it is not a programming solution, you could solve it by setting the calendar item for the 1st of the month and set a reminder to popup on the day before the event.