From c30e52e199c31ccb0a61b4c9d742e6b2fcb2c5d0 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Sat, 25 Mar 2023 11:43:18 +0100 Subject: [PATCH] Notes on the Solar Hijri calendar A little reading leads me to learn that there are several variants, so document which this one is; also note the accurate form of the yearLength constant, and fix a mis-indented comment-end. Change-Id: Ia1987dda9f4caee4e52c0cfd894976908c8f4b1a Reviewed-by: Thiago Macieira --- src/corelib/time/qjalalicalendar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/time/qjalalicalendar.cpp b/src/corelib/time/qjalalicalendar.cpp index f33e9f3097..fcbdf14395 100644 --- a/src/corelib/time/qjalalicalendar.cpp +++ b/src/corelib/time/qjalalicalendar.cpp @@ -15,8 +15,9 @@ using namespace QRoundingDown; constexpr qint64 cycleDays = 1029983; constexpr int cycleYears = 2820; -constexpr double yearLength = 365.24219858156028368; // 365 + leapRatio; +constexpr double yearLength = 365.24219858156028368; // 365 + 683 / 2820. constexpr qint64 jalaliEpoch = 2121446; // 475/01/01 AP, start of 2820 cycle +// This appears to be based on Ahmad Birashk's algorithm. // Calendar implementation @@ -75,7 +76,7 @@ qint64 firstDayOfYear(int year, int cycleNo) Source: \l {https://en.wikipedia.org/wiki/Solar_Hijri_calendar}{Wikipedia page on Solar Hijri Calendar} - */ +*/ QString QJalaliCalendar::name() const {