20 #ifndef KLOCALIZEDDATE_H 21 #define KLOCALIZEDDATE_H 26 #include <kdelibs4support_export.h> 29 class KLocalizedDatePrivate;
173 KLocalizedDate(
int year,
int month,
int day,
const KCalendarSystem *calendar =
nullptr);
180 KLocalizedDate(
const KLocalizedDate &rhs);
187 KLocalizedDate &operator=(
const KLocalizedDate &rhs);
194 KLocalizedDate &operator=(
const QDate &rhs);
260 bool isValid()
const;
282 bool setDate(
int year,
int month,
int day);
292 bool setDate(
int year,
int dayOfYear);
305 bool setDate(
QString eraName,
int yearInEra,
int month,
int day);
328 bool setCurrentDate();
337 static KLocalizedDate currentDate();
346 static KLocalizedDate fromDate(
const QDate &date);
356 static KLocalizedDate fromJulianDay(
int jd);
364 int toJulianDay()
const;
385 void getDate(
int *year,
int *month,
int *day)
const;
449 int yearInEra()
const;
461 int dayOfYear()
const;
475 int dayOfWeek()
const;
495 int week(
int *yearNum =
nullptr)
const;
528 int monthsInYear()
const;
542 int weeksInYear()
const;
571 int daysInYear()
const;
581 int daysInMonth()
const;
591 int daysInWeek()
const;
599 bool isLeapYear()
const;
772 static KLocalizedDate readDate(
const QString &dateString,
794 static KLocalizedDate readDate(
const QString &dateString,
818 static KLocalizedDate readDate(
const QString &dateString,
833 KLocalizedDate addYears(
int years)
const;
847 bool addYearsTo(
int years);
858 KLocalizedDate addMonths(
int months)
const;
872 bool addMonthsTo(
int months);
883 KLocalizedDate addDays(
int days)
const;
897 bool addDaysTo(
int days);
922 void dateDifference(
const KLocalizedDate &toDate,
923 int *yearsDiff,
int *monthsDiff,
int *daysDiff,
int *direction)
const;
948 void dateDifference(
const QDate &toDate,
949 int *yearsDiff,
int *monthsDiff,
int *daysDiff,
int *direction)
const;
964 int yearsDifference(
const KLocalizedDate &toDate)
const;
979 int yearsDifference(
const QDate &toDate)
const;
996 int monthsDifference(
const KLocalizedDate &toDate)
const;
1013 int monthsDifference(
const QDate &toDate)
const;
1024 int daysDifference(
const KLocalizedDate &toDate)
const;
1035 int daysDifference(
const QDate &toDate)
const;
1043 KLocalizedDate firstDayOfYear()
const;
1051 KLocalizedDate lastDayOfYear()
const;
1059 KLocalizedDate firstDayOfMonth()
const;
1067 KLocalizedDate lastDayOfMonth()
const;
1074 bool operator==(
const KLocalizedDate &other)
const;
1081 bool operator==(
const QDate &other)
const;
1088 bool operator!=(
const KLocalizedDate &other)
const;
1095 bool operator!=(
const QDate &other)
const;
1102 bool operator<(
const KLocalizedDate &other)
const;
1109 bool operator<(
const QDate &other)
const;
1116 bool operator<=(
const KLocalizedDate &other)
const;
1123 bool operator<=(
const QDate &other)
const;
1130 bool operator>(
const KLocalizedDate &other)
const;
1137 bool operator>(
const QDate &other)
const;
1144 bool operator>=(
const KLocalizedDate &other)
const;
1151 bool operator>=(
const QDate &other)
const;
1188 #endif // KLOCALIZEDDATE_H
DateFormat
Format for date string.
Parse Date/Time liberally.
The system locale default for the componant.
KCalendarSystem abstract base class, provides support for local Calendar Systems in KDE...
QDataStream KDELIBS4SUPPORT_EXPORT & operator<<(QDataStream &out, const KDateTime::Spec &spec)
Write spec to the datastream out, in binary format.
A class representing a date localized using the local calendar system, language and formats...
ReadDateFlags
Flags for readDate()
The system locale default.
QDataStream KDELIBS4SUPPORT_EXPORT & operator>>(QDataStream &in, KDateTime::Spec &spec)
Read a KDateTime::Spec object into spec from in, in binary format.
Locale Long date format, e.g.
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Sun Dec 15 2019 02:34:47 by
doxygen 1.8.11 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.