Hi Paul,

> I'm dubious about supporting astronomical calendars, because any 
> algorithm we use to calculate them will be "wrong" in some sense.

This is precisely the reason why I did not include support for the
calendar of Nepal (ne_NP locale). When I realized that [1][2][3]
  - Different web sites in the .gov.np domain have different
    Gregorian to Vikram Samvat conversions,
  - People seem to ignore the .gov.np domain and indeed follow the
    conversion from the hamropatro.com web site,
  - The calendar on this web site gets occasionally "corrected".
I gave up on this one.

But the situation for Iran is different:
> For Iran, the 1925 law that established the calendar did not specify how 
> to determine leap years. Different sources give their own methods to 
> calculate leap years, and these sources will say that the other sources 
> are inaccurate for dates in the future or far in the past. It's better 
> to not get into the middle of these conflicts.

For Iran, there is an authoritative source (some institute at the
university of Teheran), cited by the wikipedia page [4] that gives the
complete list of leap years for the time period that we are interested
in (1925 to 2100). I verified that this list of leap years is consistent
with what the English wikipedia page states [5].

The Emacs cal-persia.el gives different leap years, and that's maybe OK
if they want stability across several cycles of 2820 years and don't
care about Iran.

(It's similar to the definition of time, in Germany, that for many years
was defined by an institute [6] — including leap seconds.)

> If we do support an astronomical calendar despite these hazards, then we 
> should be careful not to call it "the Persian calendar" or even "the 
> Persian solar Hijri calendar". Instead, we should call it something like 
> "the Persian calendar as specified on Wikipedia in 2025" (but use the 
> actual source, not Wikipedia), and use a similar qualifier as part of 
> the programmatic name rather than just calling the function 
> "gregorian_to_persian".

The title (first line) of the file is:
  Support for the Persian solar Hijri calendar (used in Iran).

In other words, it's clear that what matters is the actual use in Iran,
not some astronomical calculation.

> I assume the Thai solar calendar is similar since it's astronomical. 
> However, I know little about it.

The Thai calendar, starting with 1941 A.D., is the same regarding the
months and leap years as the Gregorian calendar. It only has the year
offset by 543. Very simple. (The Thai calendar before 1941, though,
is not so simple.)

Bruno

[1] https://github.com/opensource-nepal/node-nepali-datetime/issues/82
[2] https://github.com/opensource-nepal/node-nepali-datetime/issues/83
[3] https://github.com/medic/bikram-sambat/issues/26
[4] 
https://fa.wikipedia.org/wiki/%DA%AF%D8%A7%D9%87%E2%80%8C%D8%B4%D9%85%D8%A7%D8%B1%DB%8C_%D8%B1%D8%B3%D9%85%DB%8C_%D8%A7%DB%8C%D8%B1%D8%A7%D9%86
[5] 
https://en.wikipedia.org/wiki/Solar_Hijri_calendar#Comparison_with_Gregorian_calendar
[6] https://www.ptb.de/




Reply via email to