From: Claudio Cambra Date: Tue, 8 Aug 2023 10:48:35 +0000 (+0800) Subject: Ensure leading zero dates are also correctly parsed X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~92^2^2~7^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7cfd4d877b88a252cd31c012b281abb8c1f1cf79;p=nextcloud-desktop.git Ensure leading zero dates are also correctly parsed Signed-off-by: Claudio Cambra --- diff --git a/src/gui/filedetails/datefieldbackend.cpp b/src/gui/filedetails/datefieldbackend.cpp index 6c0436978..89556c8cc 100644 --- a/src/gui/filedetails/datefieldbackend.cpp +++ b/src/gui/filedetails/datefieldbackend.cpp @@ -25,16 +25,29 @@ namespace Quick DateFieldBackend::DateFieldBackend(QObject *const parent) : QObject(parent) { + _dateFormat = QLocale::system().dateFormat(QLocale::ShortFormat); + // Ensure the date format is for a full year. QLocale::ShortFormat often // provides a short year format that is only two years, which is an absolute - // pain to work with -- ensure instead we have the full, unambiguous year - _dateFormat = QLocale::system().dateFormat(QLocale::ShortFormat); + // pain to work with -- ensure instead we have the full, unambiguous year. // Check for specifically two y's, no more and no fewer, within format date - const QRegularExpression re("(?