From 330c3e91eeed631e084b68454c3fbc248a1b4bb1 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 12 Jan 2023 10:03:14 +0100 Subject: 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 Reviewed-by: Sami Shalayel --- src/qml/jsruntime/qv4dateobject.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/qml/jsruntime/qv4dateobject.cpp') 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()) -- cgit v1.2.3