![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QJalaliCalendar class provides Jalali (Hijri Shamsi) calendar system implementation. More...
#include <qjalalicalendar_p.h>
Public Member Functions | |
| QString | name () const override |
| Returns the primary name of the calendar. | |
| int | daysInMonth (int month, int year=QCalendar::Unspecified) const override |
| Returns number of days in the month number month, in year year. | |
| bool | isLeapYear (int year) const override |
Returns true if the specified year is a leap year for this calendar. | |
| bool | isLunar () const override |
Returns true if this calendar is a lunar calendar. | |
| bool | isLuniSolar () const override |
Returns true if this calendar is a lunisolar calendar. | |
| bool | isSolar () const override |
Returns true if this calendar is a solar calendar. | |
| bool | dateToJulianDay (int year, int month, int day, qint64 *jd) const override |
| Computes the Julian day number corresponding to the specified year, month, and day. | |
| QCalendar::YearMonthDay | julianDayToDate (qint64 jd) const override |
| Computes the year, month, and day in this calendar for the given Julian day number jd. | |
| Public Member Functions inherited from QCalendarBackend | |
| QCalendarBackend ()=default | |
| virtual | ~QCalendarBackend () |
| Destroys the calendar backend. | |
| QStringList | names () const |
| Returns list of names this backend was registered with. | |
| QCalendar::System | calendarSystem () const |
| The calendar system of this calendar. | |
| QCalendar::SystemId | calendarId () const |
| virtual int | daysInYear (int year) const |
| Returns the total number of days in the year number year. | |
| virtual int | monthsInYear (int year) const |
| Returns the total number of months in the year number year. | |
| virtual bool | isDateValid (int year, int month, int day) const |
Returns true if the date specified by year, month, and day is valid for this calendar; otherwise returns false. | |
| virtual bool | isProleptic () const |
Returns true if this calendar is a proleptic calendar. | |
| virtual bool | hasYearZero () const |
Returns true if year number 0 is considered a valid year in this calendar. | |
| virtual int | maximumDaysInMonth () const |
| Returns the maximum number of days in a month for any year. | |
| virtual int | minimumDaysInMonth () const |
| Returns the minimum number of days in any valid month of any valid year. | |
| virtual int | maximumMonthsInYear () const |
| Returns the maximum number of months possible in any year. | |
| virtual int | dayOfWeek (qint64 jd) const |
| Returns the day of the week for the given Julian Day Number jd. | |
| virtual qint64 | matchCenturyToWeekday (const QCalendar::YearMonthDay &parts, int dow) const |
| virtual QString | monthName (const QLocale &locale, int month, int year, QLocale::FormatType format) const |
| Returns the name of the specified month in the given year for the chosen locale, using the given format to determine how complete the name is. | |
| virtual QString | standaloneMonthName (const QLocale &locale, int month, int year, QLocale::FormatType format) const |
| Returns the standalone name of the specified month in the chosen locale, using the specified format to determine how complete the name is. | |
| virtual QString | weekDayName (const QLocale &locale, int day, QLocale::FormatType format) const |
| Returns the name of the specified day of the week in the chosen locale, using the specified format to determine how complete the name is. | |
| virtual QString | standaloneWeekDayName (const QLocale &locale, int day, QLocale::FormatType format) const |
| Returns the standalone name of the specified day of the week in the chosen locale, using the specified format to determine how complete the name is. | |
| virtual QString | dateTimeToString (QStringView format, const QDateTime &datetime, QDate dateOnly, QTime timeOnly, const QLocale &locale) const |
| Returns a string representing a given date, time or date-time. | |
| bool | isGregorian () const |
| QCalendar::SystemId | registerCustomBackend (const QStringList &names) |
| Register this backend as a custom backend. | |
Static Public Member Functions | |
| static QStringList | nameList () |
| Static Public Member Functions inherited from QCalendarBackend | |
| static QStringList | availableCalendars () |
| Returns a list of names of the available calendar systems. | |
Protected Member Functions | |
| const QCalendarLocale * | localeMonthIndexData () const override |
| const char16_t * | localeMonthData () const override |
The QJalaliCalendar class provides Jalali (Hijri Shamsi) calendar system implementation.
\inmodule QtCore
The Solar Hijri calendar, also called the Solar Hejri calendar, Shamsi Hijri calendar or Jalali calendar, is the official calendar of Iran and Afghanistan. It begins on the vernal equinox (Nowruz) as determined by astronomical calculation for the Iran Standard Time meridian (52.5°E or GMT+3.5h). This determination of starting moment is more accurate than the Gregorian calendar for predicting the date of the vernal equinox, because it uses astronomical observations rather than mathematical rules.
Each of the twelve months corresponds with a zodiac sign. The first six months have 31 days, the next five have 30 days, and the last month has 29 days in usual years but 30 days in leap years. The New Year's Day always falls on the March equinox.
The Solar Hijri calendar produces a five-year leap year interval after about every seven four-year leap year intervals. It usually follows a 33-year cycle with occasional interruptions by single 29-year or 37-year subcycles. The reason for this behavior is that it tracks the observed vernal equinox. By contrast, some less accurate predictive algorithms are in use based on confusion between the average tropical year (365.2422 days, approximated with near 128-year cycles or 2820-year great cycles) and the mean interval between spring equinoxes (365.2424 days, approximated with a near 33-year cycle).
Source: \l {https://en.wikipedia.org/wiki/Solar_Hijri_calendar}{Wikipedia page on Solar Hijri Calendar}
Definition at line 24 of file qjalalicalendar_p.h.
|
overridevirtual |
Computes the Julian day number corresponding to the specified year, month, and day.
Returns true and sets jd if there is such a date in this calendar; otherwise, returns false.
Implements QCalendarBackend.
Definition at line 119 of file qjalalicalendar.cpp.
|
overridevirtual |
Returns number of days in the month number month, in year year.
An implementation should return 0 if the given year had no such month. If year is QCalendar::Unspecified, return the usual number of days for the month, in those years that include it.
Calendars with intercallary days may represent these as extra days of the preceding month, or as short months separate from the usual ones. In the former case, daysInMonth(month, year) should be the number of ordinary days in the month, although {isDateValid(year, month, day)} might return true for some larger values of day.
Implements QCalendarBackend.
Definition at line 157 of file qjalalicalendar.cpp.
|
overridevirtual |
Returns true if the specified year is a leap year for this calendar.
Implements QCalendarBackend.
Definition at line 95 of file qjalalicalendar.cpp.
|
overridevirtual |
Returns true if this calendar is a lunar calendar.
Otherwise returns false.
A lunar calendar is a calendar based upon the monthly cycles of the Moon's phases (synodic months). This contrasts with solar calendars, whose annual cycles are based only upon the solar year.
Implements QCalendarBackend.
Definition at line 104 of file qjalalicalendar.cpp.
|
overridevirtual |
Returns true if this calendar is a lunisolar calendar.
Otherwise returns false.
A lunisolar calendar is a calendar whose date indicates both the moon phase and the time of the solar year.
Implements QCalendarBackend.
Definition at line 109 of file qjalalicalendar.cpp.
|
overridevirtual |
Returns true if this calendar is a solar calendar.
Otherwise returns false.
A solar calendar is a calendar whose dates indicate the season or almost equivalently the apparent position of the sun relative to the fixed stars. The Gregorian calendar, widely accepted as standard in the world, is an example of solar calendar.
Implements QCalendarBackend.
Definition at line 114 of file qjalalicalendar.cpp.
|
overridevirtual |
Computes the year, month, and day in this calendar for the given Julian day number jd.
If the given day falls outside this calendar's scope (e.g. before the start-date of a non-proleptic calendar), the returned structure's isValid() is false; otherwise, its year, month, and day fields provide this calendar's description of the date.
Implements QCalendarBackend.
Definition at line 135 of file qjalalicalendar.cpp.
|
overrideprotectedvirtual |
Implements QCalendarBackend.
Definition at line 176 of file qjalalicalendar.cpp.
|
overrideprotectedvirtual |
Implements QCalendarBackend.
Definition at line 171 of file qjalalicalendar.cpp.
|
overridevirtual |
Returns the primary name of the calendar.
Implements QCalendarBackend.
Definition at line 82 of file qjalalicalendar.cpp.
|
static |
Definition at line 87 of file qjalalicalendar.cpp.