From f06daaf3d8747c6c0a277bf055c80d8f2e7bcc81 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 24 Oct 2014 15:06:22 +0200 Subject: Properly handle negative years when printing JS Dates to strings. JavaScript knows a year 0. That is correctly translated into QDateTime terms when creating a Date object, but it's not correctly translated back when converting the JavaScript date to a string. Task-number: QTBUG-29491 Change-Id: I46b200a144434187656d08e87f422f97523acd0e Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmlecmascript/data/negativeyear.qml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/auto/qml/qqmlecmascript/data/negativeyear.qml (limited to 'tests/auto/qml/qqmlecmascript/data') diff --git a/tests/auto/qml/qqmlecmascript/data/negativeyear.qml b/tests/auto/qml/qqmlecmascript/data/negativeyear.qml new file mode 100644 index 0000000000..11defbe914 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/negativeyear.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 +import Qt.test 1.0 + +Item { + function check_negative() { + return "result: " + new Date(-2000, 0, 1); + } +} -- cgit v1.2.3