class KCalendarSystemabstract class |
|
|
CalendarSystem abstract class, default derived KDE Gregorian class and factory class. Provides support for different calendar types for the KDE calendar widget and related stuff. Derived classes must be created through the create() statuc method
Author Carlos Moro |
|
Constructor of abstract calendar class. This will be called by derived classes.
locale - locale to use for translations. The global locale is used if null. |
|
Returns a QDate containing a date ndays days later.
date - The old date ndays - number of days to add Returns The new date |
|
Returns a QDate containing a date nmonths months later.
date - The old date nmonths - number of months to add Returns The new date |
|
Returns a QDate containing a date nyears years later.
date - The old date nyears - The number of years to add Returns The new date |
|
Returns a typographically correct and translated label to display for the calendar system type. Use with calendarSystems() to neatly format labels to display on combo widget of available calendar systems.
calendarType - the specific calendar type to return the label for Returns label for calendar |
|
Gets a list of names of supported calendar systems. Returns list of names |
|
Returns the calendar system type. Returns type of calendar system |
|
Creates specific calendar type
calType - string identification of the specific calendar type to be constructed locale - locale to use for translations. The global locale is used if null. Returns a KCalendarSystem object |
|
Internal method to convert YMD values for this calendar system into a Julian Day number. All calendar system implementations MUST implement julianDayToDate and dateToJulianDay methods as all other methods can be expressed as functions of these. See also KCalendarSystem.julianDayToDate
year - year number month - month number day - day of month jd - Julian day number returned in this variable Returns true if the date is valid, false otherwise |
|
Gets specific calendar type day number of month for a given date
date - gregorian date equivalent to the specific one Returns day of the month |
|
Gets specific calendar type number of day of week number for a given date
date - Gregorian date Returns day of week |
|
Gets specific calendar type day number of year for a given date
date - Gregorian date equivalent to the specific one Returns day number |
|
Converts a date into a day literal
pDate - The date to convert format - The format to return, either short or long Returns The day literal of the date |
|
Converts a day literal of a part of a string into a integer starting at the beginning of the string
sNum - The string to parse iLength - The number of QChars used, and 0 if no valid symbols was found in the string Returns An integer corresponding to the day |
|
Gets specific calendar type number of days in month for a given date
date - Gregorian date Returns number of days for month in date |
|
Returns the number of days in a specified week.
date - the date to obtain week from Returns number of days in week |
|
Gets the number of days in date whose years specified.
date - Gregorian date equivalent to the specific one Returns number of days in year |
|
Returns the earliest date valid in this calendar system implementation. If the calendar system is proleptic then this may be before epoch. See also KCalendarSystem.epoch See also KCalendarSystem.latestValidDate Returns date the earliest valid date |
|
Returns a QDate holding the epoch of the calendar system. Usually YMD of 1/1/1, access the returned QDates method toJulianDay() if you require the actual Julian day number. Note: a particular calendar system implementation may not include the epoch in its supported range, or the calendar system may be proleptic in which case it supports dates before the epoch. See also KCalendarSystem.earliestValidDate See also KCalendarSystem.latestValidDate See also KCalendarSystem.isProleptic See also KCalendarSystem.isValid Returns epoch of calendar system |
|
Returns a string formatted to the current locale's conventions regarding dates. Uses the calendar system's internal locale set when the instance was created, which ensures that the correct calendar system and locale settings are respected, which would not occur in some cases if using the global locale. Defaults to global locale. See also KLocale.formatDate
date - the date to be formatted format - category of date format to use Returns The date as a string |
|
Returns whether a given year is a leap year.
year - the year to check Returns true if the year is a leap year, false otherwise |
|
Returns whether a given date falls in a leap year.
date - the date to check Returns true if the date falls in a leap year, false otherwise |
|
Returns whether the calendar is lunar based. Returns true if the calendar is lunar based, false if not |
|
Returns whether the calendar is lunisolar based. Returns true if the calendar is lunisolar based, false if not |
|
Returns whether the calendar system is proleptic, i.e. whether dates before the epoch are supported. See also KCalendarSystem.epoch Returns true if the calendar system is proleptic, false if not |
|
Returns whether the calendar is solar based. Returns true if the calendar is solar based, false if not |
|
Returns whether a given date is valid in this calendar system.
year - the year portion of the date to check month - the month portion of the date to check day - the day portion of the date to check Returns true if the date is valid, false otherwise |
|
Returns whether a given date is valid in this calendar system.
date - the date to check Returns true if the date is valid, false otherwise |
|
Internal method to convert a Julian Day number into the YMD values for this calendar system. All calendar system implementations MUST implement julianDayToDate and dateToJulianDay methods as all other methods can be expressed as functions of these. See also KCalendarSystem.dateToJulianDay
jd - Julian day number to convert to date year - year number returned in this variable month - month number returned in this variable day - day of month returned in this variable Returns true if the date is valid, false otherwise |
|
Returns the latest date valid in this calendar system implementation. See also KCalendarSystem.epoch See also KCalendarSystem.earliestValidDate Returns date the latest valid date |
|
Returns the locale used for translations and formats for this calendar system instance. This allows a calendar system instance to be independent of the global translations and formats if required. All implementations must refer to this locale. Only for internal calendar system use; if public access is required then provide public methods only for those methods actually required. Any app that creates an instance with its own locale overriding global will have the original handle to the locale and can manipulate it that way if required, e.g. to change default date format. Only expose those methods that library widgets require access to internally. See also KCalendarSystem.formatDate See also KLocale.formatDate See also KCalendarSystem.weekStartDay See also KLocale.weekStartDay See also KCalendarSystem.readDate See also KLoacle.readDate Returns locale to use |
|
Gets specific calendar type month for a given gregorian date
date - gregorian date Returns month number |
|
Gets specific calendar type month name for a given month number If an invalid month is specified, QString() is returned.
month - the month number year - the year the month belongs to format - specifies whether the short month name or long month name should be used Returns name of the month |
|
Gets specific calendar type month name for a given date
date - date to obtain month from format - specifies whether the short month name or long month name should be used Returns name of the month |
|
Converts a date into a month literal
pDate - The date to convert format - The format to return, either short or long Returns The month literal of the date |
|
Converts a month literal of a part of a string into a integer starting at the beginning of the string
sNum - The string to parse iLength - The number of QChars used, and 0 if no valid symbols was found in the string Returns An integer corresponding to the month |
|
Gets specific calendar type number of month for a given year
date - the date to obtain year from Returns number of months in that year |
|
Converts a localized date string to a QDate. The bool pointed by ok will be false if the date entered was invalid. Uses the calendar system's internal locale set when the instance was created, which ensures that the correct calendar system and locale settings are respected, which would not occur in some cases if using the global locale. Defaults to global locale. See also KLocale.readDate
str - the string to convert ok - if non-null, will be set to true if the date is valid, false if invalid Returns the string converted to a QDate |
|
Converts a localized date string to a QDate, using the specified format. You will usually not want to use this method. See also KLocale.readDate |
|
Converts a localized date string to a QDate. This method is stricter than readDate(str,&ok): it will either accept a date in full format or a date in short format, depending on flags. Uses the calendar system's internal locale set when the instance was created, which ensures that the correct calendar system and locale settings are respected, which would not occur in some cases if using the global locale. Defaults to global locale. See also KLocale.readDate
str - the string to convert flags - whether the date string is to be in full format or in short format ok - if non-null, will be set to true if the date is valid, false if invalid Returns the string converted to a QDate |
|
Changes the date's year, month and day. The range of the year, month and day depends on which calendar is being used. All years entered are treated literally, i.e. no Y2K translation is applied to years entered in the range 00 to 99. Replaces setYMD.
date - date to change year - year month - month number day - day of month Returns true if the date is valid, false otherwise |
|
Deprecated Use setDate instead See also KCalendarSystem.setDate Some implementations reject year range 00 to 99, but extended date ranges now require these to be accepted. Equivalent in QDate is obsoleted. Changes the date's year, month and day. The range of the year, month and day depends on which calendar is being used.
date - Date to change y - Year m - Month number d - Day of month Returns true if the date is valid; otherwise returns false. |
|
Gets specific calendar type week day name. If an invalid week day is specified, QString() is returned.
weekDay - number of day in week (Monday = 1, ..., Sunday = 7) format - specifies whether the short month name or long month name should be used Returns day name |
|
Gets specific calendar type week day name.
date - the date format - specifies whether the short month name or long month name should be used Returns day name |
|
Gets the day of the week traditionally associated with prayer. Returns day number (Monday = 1, ..., Sunday = 7) |
|
Gets specific calendar type week number for a given date
date - gregorian date yearNum - the year the date belongs to Returns week number |
|
Use this to determine which day is the first day of the week. Uses the calendar system's internal locale set when the instance was created, which ensures that the correct calendar system and locale settings are respected, which would not occur in some cases if using the global locale. Defaults to global locale. See also KLocale.weekStartDay Returns an integer (Monday = 1, ..., Sunday = 7) |
|
Returns the number of ISO weeks in a specified year.
date - the date to obtain year from Returns number of weeks in year |
|
Gets the number of weeks in a specified year.
year - the year Returns number of weeks in year |
|
Gets specific calendar type year for a given Gregorian date.
date - gregorian date Returns year |
|
Converts a date into a year literal
date - date to convert format - format to return, either short or long Returns year literal of the date |
|
Converts a year literal of a part of a string into a integer starting at the beginning of the string
sNum - The string to parse iLength - The number of QChars used, and 0 if no valid symbols was found in the string Returns An integer corresponding to the year |
ShortName | - | ShortName, < Short name format, e.g. "Dec" | |
LongName | - | LongName, < Long name format, e.g. "December" | |
ShortNamePossessive | - | ShortNamePossessive, < Short name possessive format, e.g. "of Dec" | |
LongNamePossessive | - | LongNamePossessive < Long name possessive format, e.g. "of December" |
ShortFormat | - | ShortFormat, < Short string format, e.g. 2000 = "00" or 6 = "6" | |
LongFormat | - | LongFormat < Long string format, e.g. 2000 = "2000" or 6 = "06" |
ShortDayName | - | ShortDayName, < Short name format, e.g. "Fri" | |
LongDayName | - | LongDayName < Long name format, e.g. "Friday" |