diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-01-12 10:03:14 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-01-17 21:58:32 +0100 |
commit | 330c3e91eeed631e084b68454c3fbc248a1b4bb1 (patch) | |
tree | 773ceeacbad032f664aff63326a82ca2d6bf80c3 /src/qml/jsruntime/qv4dateobject.cpp | |
parent | c108a817f4ccd023c3b9d9d19427b8d65eb4e348 (diff) |
V4: Unify type conversions for date and time values
We should always use the same conversion to string and we shouldn't
duplicate the code for the date conversion.
Task-number: QTBUG-109380
Change-Id: I1b1959c8e9b5957ddcf287d252b8143511237565
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 196b9d9112..98d930eece 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -707,6 +707,11 @@ QDateTime DateObject::toQDateTime() const return d()->toQDateTime(); } +QString DateObject::toString() const +{ + return ToString(d()->date(), engine()->localTZA); +} + QString DateObject::dateTimeToString(const QDateTime &dateTime, ExecutionEngine *engine) { if (!dateTime.isValid()) |