diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2012-09-21 11:30:55 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-24 01:38:49 +0200 |
commit | 811bf4da67cedea0daa40f2fff805003687e9d6e (patch) | |
tree | 079edf87129a3c16bc8e8562dbc4669527084f2b /src/corelib/tools/qlocale.cpp | |
parent | d1ad991bee52e17452cae9dca55b3b340c6f0955 (diff) |
Output leading zeroes for yyyy date formats in QLocale::toString().
Converting the date 1 January 0001 to a string in the format
"dd MMMM yyyy" currently results in the string "01 January 1", but it
should be "01 January 0001".
Task-number: QTBUG-27287
Change-Id: Ia025da7343d1c36aaee34c47c6db551a6e89595f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 368cb444a3..97946b52c8 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -2262,7 +2262,7 @@ QString QLocalePrivate::dateTimeToString(const QString &format, const QDate *dat switch (repeat) { case 4: - result.append(longLongToString(date->year())); + result.append(longLongToString(date->year(), -1, 10, 4, QLocalePrivate::ZeroPadded)); break; case 2: result.append(longLongToString(date->year() % 100, -1, 10, 2, |