File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/plugin-datetime/operation Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -933,7 +933,12 @@ void DatetimeModel::setCurrentFormat(int format, int index)
933933
934934QString DatetimeModel::currentDate ()
935935{
936- QLocale locale (QLocale::system ().name ());
936+ QLocale locale;
937+ if (m_regions.contains (m_langCountry)) {
938+ locale = m_regions.value (m_langCountry);
939+ } else {
940+ locale = QLocale (m_localeName);
941+ }
937942 QString week = weekdayFormat () == 1 ? " ddd" : " dddd" ;
938943 QString dateFormat = shortDateFormat () + " " + week;
939944
@@ -942,7 +947,12 @@ QString DatetimeModel::currentDate()
942947
943948QString DatetimeModel::currentTime () const
944949{
945- QLocale locale (QLocale::system ().name ());
950+ QLocale locale;
951+ if (m_regions.contains (m_langCountry)) {
952+ locale = m_regions.value (m_langCountry);
953+ } else {
954+ locale = QLocale (m_localeName);
955+ }
946956 QString timeFormat = longTimeFormat ();
947957 // remove all occurrences of 't' and '[tttt]' or similar patterns
948958 timeFormat.remove (QRegularExpression (" (\\ [t+?\\ ]|t+)" ));
You can’t perform that action at this time.
0 commit comments