emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [POLL] Dealing with +1m/y repeaters when jumping to impossible date


From: Max Nikulin
Subject: Re: [POLL] Dealing with +1m/y repeaters when jumping to impossible date (should 05-31 +1m be 07-01 or 06-30?)
Date: Sat, 6 Apr 2024 21:52:00 +0700
User-agent: Mozilla Thunderbird

On 06/04/2024 01:34, Ihor Radchenko wrote:
Generally, I did see several requests to change the strategy when
calculating next month/year. However, that would be a breaking change.
I'd only go for it if people are strongly in favor of the change.
So, changing this to a poll.

I think the following should be taken into account: behavior of popular calendar applications, specifications they implement, libraries that likely used to create such applications.

Should it be configurable per user, per file, or even per rule (timestamp with repeater)?

I am not familiar with RFC5545 iCalendar, so I am unsure what options it recommends.

An example of recently designed library (however Org does not support calendars with leap *months*):
<https://tc39.es/proposal-temporal/docs/calendar.html#handling-unusual-dates-leap-days-leap-months-and-skipped-or-repeated-periods>
"Handling unusual dates: leap days, leap months, and skipped or repeated periods" (Temporal proposal for JavaScript)

When Temporal encounters inputs representing a month and/or day that
doesn't exist in the desired calendar year, by default (overridable in
with or from via the overflow option) the inputs will be adjusted using
the following algorithm:

- First, pick the closest day in the same month. If there are two
equally-close dates in that month, pick the later one.
- If the month is a leap month that doesn't exist in the desired year,
then pick another date according to the cultural conventions of that
calendar's users. Usually this will result in the same day in the month
before or the month after where that month would normally fall in a leap
year.
- Otherwise, pick the closest date to the provided date that is still in
the same year. If there are two equally-close dates, pick the later one.
- If the entire year doesn't exist, then pick the closest date to the
provided date. If there are two equally-close dates, pick the later one.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]