Jalali (Hijri Shamsi, or Solaro Hijri) is the calendar used in Iran and Afghanistan. It shares the same epoch (start date, Hijra) with the (Lunar) Hijri calendar which is available in Libreoffice as i18npool/source/calendar/calendar_hijri.cxx. The difference is that the Jalali calendar uses solar years.
An introduction to Jalali calendar can be found here:
Solar Hijri calendar
Currently, people may use a macro to be able to use Jalali Calendar, but it has its own shortcomings:
Persian or Jalali Calndar for Calc
A good FOSS implementation of Jalali calendar is available in C programming language without extra dependencies:
It has been used in Ubuntu, Debian and elsewhere:
Note that *only* the libjalali sources
are licensed LGPLv3+ and could be used as external module, jcal itself is GPLv3+ and as such can not be incorporated into LibreOffice source code.
The library is available in Debian as
and in Fedora as
Original upstream appears to be
It would be good to have support for Persian calendar in LibreOffice.
First of all, we need some clarity here. Several terms seem mixed, creating confusion and a way to mistakes: Jalali and Hijri Shamsi, which are *different* calendars, the former being a non-algorithmic one, defined by ongoing astronomical observations. The latter one is said to use 33 (sometimes 29) year cycles, also requiring periodical synchronization using astronomical data. But the libjalali, mentioned further, is implemented using 2820 years cycle , which is "Birashk leap year algorithm" , said to be an *alternative* computation method suggested in early XX century, and to be much less precise than both Jalali and Hijri.
The existence of the library in the distro repos sais nothing about its usage to implement system calendar using it. Is it actually used for the purpose? And more importantly - does it match what Excel implemented? We likely need a spreadsheet from Excel with important dates for very large period helping make sure we do it properly.
(In reply to Mike Kaganski from comment #3)
> "Birashk leap year algorithm" , said
> to be an *alternative* computation method suggested in early XX century, and
> to be much less precise than both Jalali and Hijri.
Indeed, not "early" but "late"; let me quote some Wikipedia:
> Some predictive algorithms had been suggested, but were inaccurate due to
> confusion between the average tropical year (365.2422 days) and the mean
> interval between spring equinoxes (365.2424 days). These algorithms are not
> generally used (see Accuracy).
> Iranian mathematician Ahmad Birashk (1907–2002) proposed an alternative means
> of determining leap years. Birashk's book came out in 1993, and his algorithm
> was based on the same apparently erroneous presumptions as used by Zabih
> Behruz in his book from 1952.
> The accuracy of the system proposed by Birashk and other recent authors, such
> as Zabih Behruz, has been thoroughly refuted and shown to be less precise than
> the traditional 33-year cycle.