KDECore
klocalizeddate.cpp
Go to the documentation of this file.
34 explicit KLocalizedDatePrivate(const QDate &date, const KCalendarSystem *calendar, bool manageCalendar);
44 KLocalizedDatePrivate::KLocalizedDatePrivate(const QDate &date, const KCalendarSystem *calendar, bool manageCalendar)
61 m_calendar = KCalendarSystem::create(m_calendar->calendarSystem(), new KLocale(*m_calendar->locale()));
73 m_calendar = KCalendarSystem::create(m_calendar->calendarSystem(), new KLocale(*m_calendar->locale()));
98 KLocalizedDate::KLocalizedDate(int year, int month, int day, const KCalendarSystem *calendarSystem)
203 bool KLocalizedDate::setDate(KLocale::WeekNumberSystem weekNumberSystem, int year, int isoWeekNumber, int dayOfIsoWeek)
354 QString KLocalizedDate::formatDate(const QString &toFormat, KLocale::DateTimeFormatStandard formatStandard) const
void dateDifference(const KLocalizedDate &toDate, int *yearsDiff, int *monthsDiff, int *daysDiff, int *direction) const
Returns the difference between this and another date in years, months and days in the current Calenda...
Definition: klocalizeddate.cpp:454
bool operator<(const KLocalizedDate &other) const
KLocalizedDate less than operator.
Definition: klocalizeddate.cpp:550
virtual bool isLeapYear(int year) const =0
Returns whether a given year is a leap year.
Definition: kcalendarsystem.cpp:1720
bool setDateIsoWeek(QDate &date, int year, int isoWeekNumber, int dayOfIsoWeek) const
Definition: kcalendarsystem.cpp:1272
static QString calendarLabel(const QString &calendarType)
Definition: kcalendarsystem.cpp:78
QString toString(Qt::DateFormat format) const
void setCalendarSystem(KLocale::CalendarSystem calendarSystem)
Set the Calendar System used for this date instance only.
Definition: klocalizeddate.cpp:131
KLocalizedDate lastDayOfYear() const
Returns a KLocalizedDate containing the last day of the currently set year.
Definition: klocalizeddate.cpp:503
void getDate(int *year, int *month, int *day) const
Returns the year, month and day portion of the date in the current Calendar System.
Definition: klocalizeddate.cpp:253
int yearInEra() const
Returns the Year In Era portion of the date in the current calendar system, for example 1 for "1 BC"...
Definition: klocalizeddate.cpp:283
QDebug & nospace()
KLocalizedDate firstDayOfMonth() const
Returns a KLocalizedDate containing the first day of the currently set month.
Definition: klocalizeddate.cpp:510
virtual int day(const QDate &date) const
Returns the day portion of a given date in the current calendar system.
Definition: kcalendarsystem.cpp:1357
QDataStream & operator<<(QDataStream &out, const KLocalizedDate &date)
Data stream output operator.
Definition: klocalizeddate.cpp:590
virtual int daysInWeek(const QDate &date) const
Returns the number of days in the given week.
Definition: kcalendarsystem.cpp:1668
static KLocalizedDate fromJulianDay(int jd)
Returns a KLocalizedDate set the required Julian Day number in the Global Locale and Calendar System...
Definition: klocalizeddate.cpp:232
QString eraName() const
Returns the Era Name portion of the date in the current calendar system, for example "AD" or "Anno Do...
Definition: klocalizeddate.cpp:273
static KCalendarSystem * create(const QString &calType=QLatin1String("gregorian"), const KLocale *locale=0)
Definition: kcalendarsystem.cpp:47
int day() const
Returns the day portion of the date in the current calendar system.
Definition: klocalizeddate.cpp:268
KLocalizedDate(const QDate &date=QDate(), const KCalendarSystem *calendar=0)
Constructs a localized date with the given date.
Definition: klocalizeddate.cpp:93
KCalendarSystem abstract base class, provides support for local Calendar Systems in KDE...
Definition: kcalendarsystem.h:40
KLocalizedDate firstDayOfYear() const
Returns a KLocalizedDate containing the first day of the currently set year.
Definition: klocalizeddate.cpp:496
KLocalizedDate addYears(int years) const
Returns a KLocalizedDate containing a date years years later.
Definition: klocalizeddate.cpp:414
int weeksInYear() const
Returns the number of localized weeks in the currently set year.
Definition: klocalizeddate.cpp:313
bool operator>(const KLocalizedDate &other) const
KLocalizedDate greater than operator.
Definition: klocalizeddate.cpp:570
const KCalendarSystem * calendar() const
Returns a pointer to the calendar system object.
Definition: klocale.cpp:705
int toJulianDay() const
Returns the currently set date as a Julian Day number.
Definition: klocalizeddate.cpp:243
int week(int *yearNum=0) const
Returns the localized Week Number for the date.
Definition: klocalizeddate.cpp:298
virtual int dayOfYear(const QDate &date) const
Returns the day number of year for the given date.
Definition: kcalendarsystem.cpp:1675
virtual QString formatDate(const QDate &fromDate, KLocale::DateFormat toFormat=KLocale::LongDate) const
Returns a string formatted to the current locale's conventions regarding dates.
Definition: kcalendarsystem.cpp:2048
virtual int monthsInYear(const QDate &date) const
Returns number of months in the given year.
Definition: kcalendarsystem.cpp:1563
bool isNull() const
virtual int weeksInYear(const QDate &date) const
Returns the number of localized weeks in the given year.
Definition: kcalendarsystem.cpp:1586
A class representing a date localized using the local calendar system, language and formats...
Definition: klocalizeddate.h:138
KDE Default, hybrid of Gregorian and Julian as used by QDate.
Definition: klocale.h:781
virtual int month(const QDate &date) const
Returns the month portion of a given date in the current calendar system.
Definition: kcalendarsystem.cpp:1344
int dayOfYear() const
Returns the day number of year for the date.
Definition: klocalizeddate.cpp:288
KLocalizedDate addMonths(int months) const
Returns a KLocalizedDate containing a date months months later.
Definition: klocalizeddate.cpp:428
int yearsDifference(const QDate &fromDate, const QDate &toDate) const
Returns the difference between two dates in completed calendar years.
Definition: kcalendarsystem.cpp:1530
const KCalendarSystem * calendar() const
Returns a pointer to the Calendar System object used by this date instance.
Definition: klocalizeddate.cpp:149
void dateDifference(const QDate &fromDate, const QDate &toDate, int *yearsDiff, int *monthsDiff, int *daysDiff, int *direction) const
Returns the difference between two dates in years, months and days.
Definition: kcalendarsystem.cpp:1519
bool isValid() const
Returns whether the date is valid in the current Calendar System.
Definition: klocalizeddate.cpp:168
KLocalizedDate & operator=(const KLocalizedDate &rhs)
Assignment operator.
Definition: klocalizeddate.cpp:109
bool operator==(const KLocalizedDate &other) const
KLocalizedDate equality operator.
Definition: klocalizeddate.cpp:530
int monthsDifference(const KLocalizedDate &toDate) const
Returns the difference between this and another date in completed calendar months in the current Cale...
Definition: klocalizeddate.cpp:476
QString formatDate(KLocale::DateFormat dateFormat=KLocale::LongDate) const
Returns the Date as a localized string in the requested standard Locale format.
Definition: klocalizeddate.cpp:349
static KLocalizedDate fromDate(const QDate &date)
Returns a KLocalizedDate set the required date in the Global Locale and Calendar System.
Definition: klocalizeddate.cpp:227
int month() const
Returns the month portion of the date in the current calendar system.
Definition: klocalizeddate.cpp:263
virtual bool isValid(int year, int month, int day) const =0
Returns whether a given date is valid in this calendar system.
Definition: kcalendarsystem.cpp:1133
int monthsDifference(const QDate &fromDate, const QDate &toDate) const
Returns the difference between two dates in completed calendar months The returned value will be nega...
Definition: kcalendarsystem.cpp:1542
QDebug & space()
QString eraYear() const
Returns the Era Year portion of the date in the current calendar system, for example "2000 AD" or "He...
Definition: klocalizeddate.cpp:278
QDataStream & operator>>(QDataStream &in, KLocalizedDate &date)
Data stream input operator.
Definition: klocalizeddate.cpp:595
bool operator!=(const KLocalizedDate &other) const
KLocalizedDate inequality operator.
Definition: klocalizeddate.cpp:540
virtual int year(const QDate &date) const
Returns the year portion of a given date in the current calendar system.
Definition: kcalendarsystem.cpp:1331
KLocalizedDate lastDayOfMonth() const
Returns a KLocalizedDate containing the last day of the currently set month.
Definition: klocalizeddate.cpp:517
int yearInEra(const QDate &date) const
Definition: kcalendarsystem.cpp:1400
KLocalizedDate addDays(int days) const
Returns a KLocalizedDate containing a date days days later.
Definition: klocalizeddate.cpp:441
virtual QDate readDate(const QString &str, bool *ok=0) const
Converts a localized date string to a QDate.
Definition: kcalendarsystem.cpp:2333
virtual QDate addMonths(const QDate &date, int nmonths) const
Returns a QDate containing a date nmonths months later.
Definition: kcalendarsystem.cpp:1463
virtual int daysInYear(const QDate &date) const
Returns the number of days in the given year.
Definition: kcalendarsystem.cpp:1620
KLocale provides support for country specific stuff like the national language.
Definition: klocale.h:69
bool isLeapYear() const
Returns whether the currently set date falls in a Leap Year in the current Calendar System...
Definition: klocalizeddate.cpp:338
static KLocalizedDate readDate(const QString &dateString, KLocale::DateTimeParseMode parseMode=KLocale::LiberalParsing, const KCalendarSystem *calendar=0)
Converts a localized date string to a KLocalizedDate using either the Global Calendar System and Loca...
Definition: klocalizeddate.cpp:372
int week(const QDate &date, int *yearNum=0) const
Returns the localized Week Number for the date.
Definition: kcalendarsystem.cpp:1703
QDate currentDate()
int daysDifference(const KLocalizedDate &toDate) const
Returns the difference between this and another date in days The returned value will be negative if t...
Definition: klocalizeddate.cpp:486
static KLocale::CalendarSystem calendarSystem(const QString &calendarType)
Definition: kcalendarsystem.cpp:183
virtual QDate addYears(const QDate &date, int nyears) const
Returns a QDate containing a date nyears years later.
Definition: kcalendarsystem.cpp:1435
QDate fromJulianDay(int jd)
virtual QDate addDays(const QDate &date, int ndays) const
Returns a QDate containing a date ndays days later.
Definition: kcalendarsystem.cpp:1502
int daysDifference(const QDate &fromDate, const QDate &toDate) const
Returns the difference between two dates in days The returned value will be negative if fromDate > to...
Definition: kcalendarsystem.cpp:1554
KLocale::CalendarSystem calendarSystem()
Returns the Calendar System used by this localized date instance.
Definition: klocalizeddate.cpp:144
void getDate(const QDate date, int *year, int *month, int *day) const
Definition: kcalendarsystem.cpp:1307
virtual bool setDate(QDate &date, int year, int month, int day) const
Changes the date's year, month and day.
Definition: kcalendarsystem.cpp:1222
static KLocalizedDate currentDate()
Returns a KLocalizedDate set to today's date in the Global Locale and Calendar System.
Definition: klocalizeddate.cpp:222
virtual int dayOfWeek(const QDate &date) const
Returns the weekday number for the given date.
Definition: kcalendarsystem.cpp:1686
int year() const
Returns the year portion of the date in the current calendar system.
Definition: klocalizeddate.cpp:258
bool operator>=(const KLocalizedDate &other) const
KLocalizedDate greater than or equal to operator.
Definition: klocalizeddate.cpp:580
int yearsDifference(const KLocalizedDate &toDate) const
Returns the difference between this and another date in completed calendar years in the current Calen...
Definition: klocalizeddate.cpp:466
virtual int daysInMonth(const QDate &date) const
Returns the number of days in the given month.
Definition: kcalendarsystem.cpp:1643
bool operator<=(const KLocalizedDate &other) const
KLocalizedDate less than or equal to operator.
Definition: klocalizeddate.cpp:560
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.