From aa8393c94fea01a4806b204fd3aa343a4e90666b Mon Sep 17 00:00:00 2001 From: Soroush Rabiei Date: Sat, 14 Jan 2017 20:23:31 +0330 Subject: Add support for calendars beside Gregorian Add QCalendarBackend as a base class for calendar implementations and QCalendar as a facade via which to access it. QDate's implicit implementation of the Gregorian calendar becomes QGregorianCalendar and QDate methods now support choice of calendar. Convert QLocale's CLDR data for month names to a locale-data component of each supported calendar and relevant QLocale methods now support choice of calendar. Adapt Python scripts for locale data generation to extract month name data from CLDR (keeping on version v35.1) into the new calendar-locale files. The locale data for the Gregorian calendar is held in a Roman calendar base, for sharing with other calendars. Add tests for basic uses of the new API. [ChangeLog][QtCore][QCalendar] Added QCalendar to support diverse calendars, supported by implementing QCalendarBackend. [ChangeLog][QtCore][QDate] Allow choice of calendar in various operations, with Gregorian remaining the default. Done-with: Lars Knoll Done-with: Edward Welbourne Fixes: QTBUG-17110 Fixes: QTBUG-950 Change-Id: I9d6278f394269a183aee8156e990cec4d5198ab8 Reviewed-by: Volker Hilsheimer --- src/corelib/time/time.pri | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/corelib/time/time.pri') diff --git a/src/corelib/time/time.pri b/src/corelib/time/time.pri index bacb7e875d..41896898f6 100644 --- a/src/corelib/time/time.pri +++ b/src/corelib/time/time.pri @@ -1,10 +1,20 @@ # Qt time / date / zone / calendar module HEADERS += \ + time/qcalendar.h \ + time/qcalendarbackend_p.h \ + time/qcalendarmath_p.h \ time/qdatetime.h \ - time/qdatetime_p.h + time/qdatetime_p.h \ + time/qgregoriancalendar_p.h \ + time/qromancalendar_p.h \ + time/qromancalendar_data_p.h -SOURCES += time/qdatetime.cpp +SOURCES += \ + time/qdatetime.cpp \ + time/qcalendar.cpp \ + time/qgregoriancalendar.cpp \ + time/qromancalendar.cpp qtConfig(timezone) { HEADERS += \ -- cgit v1.2.3 From 3e771a8b09cd5e46c4aff0e8bd28b946dd4e3fa5 Mon Sep 17 00:00:00 2001 From: Soroush Rabiei Date: Thu, 8 Aug 2019 20:15:09 +0200 Subject: Add support for Julian and Milankovic calendars These share their locale data with the Gregorian calendar, making them virtually free to add. Still leave them out of the boot-strap build, though. [ChangeLog][QtCore][QCalendar] Added support for Julian and Milankovic calendars. These are enabled by default, except in bootstrap builds. Change-Id: I585045ed9e78c1e959957f6772b3e144093b701c Reviewed-by: Paul Wicking Reviewed-by: Volker Hilsheimer --- src/corelib/time/time.pri | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib/time/time.pri') diff --git a/src/corelib/time/time.pri b/src/corelib/time/time.pri index 41896898f6..17462487f3 100644 --- a/src/corelib/time/time.pri +++ b/src/corelib/time/time.pri @@ -7,6 +7,8 @@ HEADERS += \ time/qdatetime.h \ time/qdatetime_p.h \ time/qgregoriancalendar_p.h \ + time/qjuliancalendar_p.h \ + time/qmilankoviccalendar_p.h \ time/qromancalendar_p.h \ time/qromancalendar_data_p.h @@ -14,6 +16,8 @@ SOURCES += \ time/qdatetime.cpp \ time/qcalendar.cpp \ time/qgregoriancalendar.cpp \ + time/qjuliancalendar.cpp \ + time/qmilankoviccalendar.cpp \ time/qromancalendar.cpp qtConfig(timezone) { -- cgit v1.2.3 From e71bf9d5c7b14fb3e3b7f970440060c5fd9f9059 Mon Sep 17 00:00:00 2001 From: Soroush Rabiei Date: Thu, 8 Aug 2019 20:27:18 +0200 Subject: Add support for the Jalali (Solar Hijri or Persian) calendar This has its own locale data, extracted from CLDR. [ChangeLog][QtCore][QCalendar] Added support for the Jalali (Persian or Solar Hijri) calendar, controlled by feature jalalicalendar. Fixes: QTBUG-58404 Change-Id: Id5c56a10db05a4fd612aafc01615273db81ec743 Reviewed-by: Paul Wicking Reviewed-by: Volker Hilsheimer --- src/corelib/time/time.pri | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/corelib/time/time.pri') diff --git a/src/corelib/time/time.pri b/src/corelib/time/time.pri index 17462487f3..94bd614ea9 100644 --- a/src/corelib/time/time.pri +++ b/src/corelib/time/time.pri @@ -20,6 +20,14 @@ SOURCES += \ time/qmilankoviccalendar.cpp \ time/qromancalendar.cpp +qtConfig(jalalicalendar) { + SOURCES += \ + time/qjalalicalendar.cpp + HEADERS += \ + time/qjalalicalendar_p.h \ + time/qjalalicalendar_data_p.h +} + qtConfig(timezone) { HEADERS += \ time/qtimezone.h \ -- cgit v1.2.3 From 702664571252e4f5705e39a8258fc81a3fbf37d4 Mon Sep 17 00:00:00 2001 From: Soroush Rabiei Date: Thu, 8 Aug 2019 20:35:13 +0200 Subject: Add support for the Islamic Civil calendar This has its own locale data, extracted from CLDR. This data may potentially be shared with other variants on the Islamic calendar, so is handled by a separate base-class, QHijriCalendar, on which such variants may base their implementations. [ChangeLog][QtCore][QCalendar] Added support for the Islamic Civil calendar, controlled by feature islamiccivilcalendar, with locale data that can be shared with other implementations, controlled by feature hijricalendar. Fixes: QTBUG-56675 Change-Id: Idf32d3da7034baa8ec5e66ef847e59a8a2f31cbd Reviewed-by: Volker Hilsheimer --- src/corelib/time/time.pri | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/corelib/time/time.pri') diff --git a/src/corelib/time/time.pri b/src/corelib/time/time.pri index 94bd614ea9..84efbfbfd2 100644 --- a/src/corelib/time/time.pri +++ b/src/corelib/time/time.pri @@ -20,6 +20,21 @@ SOURCES += \ time/qmilankoviccalendar.cpp \ time/qromancalendar.cpp +qtConfig(hijricalendar) { + SOURCES += \ + time/qhijricalendar.cpp + HEADERS += \ + time/qhijricalendar_p.h \ + time/qhijricalendar_data_p.h +} + +qtConfig(islamiccivilcalendar) { + SOURCES += \ + time/qislamiccivilcalendar.cpp + HEADERS += \ + time/qislamiccivilcalendar_p.h +} + qtConfig(jalalicalendar) { SOURCES += \ time/qjalalicalendar.cpp -- cgit v1.2.3