summaryrefslogtreecommitdiffstats
path: root/src/plugins/tls/shared/qasn1element.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2023-11-24 11:52:31 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2023-12-08 11:40:36 +0100
commitb8fac538032cee6eb6f4e5dcbb5a31485bb59e46 (patch)
tree581cd2961d5a7815421f8d1feea9c7bd68aa6939 /src/plugins/tls/shared/qasn1element.cpp
parentc5864a96a6670d9cece5eaa18cab8c4c339f8706 (diff)
Add QCalendar::matchCenturyToWeekday()
This takes a YearMonthDay and a day-of-the-week, returning a QDate that (if possible, else invalid) has the given day of the week and differs from the YearMonthDay only in the century. This is useful when resolving dates with only two-digit year information, which can be disambiguated by the day of the week. Added tests of the new API. This adds a new virtual method to QCalendarBackend, for which that base class does provide a brute force implementation, so derived classes do not need to add implementations. It is, however, a binary-incompatible change for any backend plugins that may be in use to implement custom calendars. Worked out the details for the Gregorian calendar to make it possible to compute the right century (and whether any century works) without trial-and-error searching. Coded that up as its implementation of the new method. [ChangeLog][QtCore][QCalendar] Added a matchCenturyToWeekday() method for use when resolving dates given day, month and last two digits of the year, along with day of the week. Any custom calendar backend plugins shall need a recompile and may, optionally, implement the new virtual method behind this. Change-Id: I6003c8d9423d6bfb833957bb5120f2d423219c7a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/tls/shared/qasn1element.cpp')
0 files changed, 0 insertions, 0 deletions