Bug 72418

Summary: hijri calendar (Um ALQura )
Product: [Plasma] plasmashell Reporter: Yousef <alharthi>
Component: Digital Clock widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: jlayt, qydwhotmail
Priority: NOR    
Version First Reported In: 5.26.0   
Target Milestone: 1.0   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6
Sentry Crash Report:

Description Yousef 2004-01-11 21:28:48 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Hello ,
 
There are many ways of computing Hijri calendar, however, the only
  Hijri calendar which is officially used is the Umm-AlQura calendar
  which is used in Saudia Arabia for all official dating.
  This program is excatly compitable with the Umm-AlQura calendar,
  the program computes the calendar based on tables, the information
  for each year is stored in a single (16bit)integer value in the MonthMap[].
  The first 4bits stores the difference of the Julian Day of the
  begining of the Hijri year and the estimated Julian Day of the that year.
  The 12bits store the information for the length of each month, 0=29 1=30.
 
Their core computation is in this function, their system is based on general computation and it is not compitable with Moon Visibility, and so it is not compitable with UmmAlqura and is not compitable with Moon Sighting.

Our computation  can be integrated this part:

static void gregorianToHijri(const QDate & date, int * pYear, int * pMonth,

   int * pDay)

{

  GregorianDate gregorian(date.month(),date.day(),date.year());

  int absolute = gregorian;

 

  IslamicDate islamic(absolute);

 

  if (pYear)

    *pYear = islamic.getYear();

  if (pMonth)

    *pMonth = islamic.getMonth();

  if (pDay)

    *pDay = islamic.getDay();

}

with best wishes.

Yousef ALHarthi
Comment 1 Reinhold Kainhofer 2004-07-22 14:43:18 UTC
This is actually a wish for kdelibs, where different calendar systems can be implemented. Isn't a hijri calendar alrady implemented there?

Reinhold
Comment 2 John Layt 2008-10-16 21:11:20 UTC
We currently have a Hijri calendar which implements a simple civil algorithm, but I am aware of some shortcomings and inconsistencies in it that may be solved by using look-up tables.  Another big issue is that it does not take sunset times into account so cannot be used for religious purposes.

We have similar issues with the Jalali calendar as well.

Assigning to me for further research.
Comment 4 Fushan Wen 2023-01-19 13:19:51 UTC
Git commit ae9b546870b94cbe2038504e779ff409d7062b6f by Fushan Wen.
Committed on 19/01/2023 at 12:36.
Pushed by fusionfuture into branch 'master'.

alternatecalendar: add support for Islamic Calendar (Astronomical and Umm al-Qura)

There are different kinds of Islamic calendars, and Qt only supports
"Islamic calendar, tabular". This adds support for another two Islamic
calendars.

The Islamic religious calendar and Saudi Arabia's Umm al-Qura
calendar, however, are based on the observation of the crescent moon.
It is thus affected by the position at which the observations are
made, seasonal variations in the time of sunset, the eccentricities of
the moon's orbit, and even the weather at the observation site. This
makes it impossible to calculate in advance, and it causes the start
of a month in the religious calendar to differ from the civil calendar
by up to three days.

Using astronomical calculations for the position of the sun and moon,
the moon's illumination, and other factors, it is possible to
determine the start of a lunar month with a fairly high degree of
certainty. However, these calculations are extremely complicated and
thus slow, so most algorithms, including the one used here, are only
approximations of the true astronomical calculations. At present, the
approximations used in this class are fairly simplistic; they will be
improved in later versions of the code.

Like the Islamic religious calendar, Umm al-Qura is also based on the
sighting method of the crescent moon but is standardized by Saudi
Arabia.

See also: https://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types
and https://developer.android.com/reference/android/icu/util/IslamicCalendar
FIXED-IN: 6

M  +1    -0    plasmacalendarplugins/alternatecalendar/CMakeLists.txt
M  +8    -7    plasmacalendarplugins/alternatecalendar/alternatecalendarplugin.cpp
M  +13   -7    plasmacalendarplugins/alternatecalendar/calendarsystem.h
M  +18   -8    plasmacalendarplugins/alternatecalendar/config/qml/AlternateCalendarConfig.qml
A  +154  -0    plasmacalendarplugins/alternatecalendar/provider/islamiccalendar.cpp     [License: GPL(v2.0+)]
A  +31   -0    plasmacalendarplugins/alternatecalendar/provider/islamiccalendar.h     [License: GPL(v2.0+)]

https://invent.kde.org/plasma/kdeplasma-addons/commit/ae9b546870b94cbe2038504e779ff409d7062b6f