Using Date() as a regular function without the new operator
returns a string and not a date object.
Change-Id: I083bb62c0cb3041a053d43e3085c3d0d10423db6
Task-number: QTBUG-41712
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
import QtQuick 2.0
Text {
- text: "The date is: " + Date().toLocaleString(Qt.locale("de_DE"))
+ text: "The date is: " + new Date().toLocaleString(Qt.locale("de_DE"))
}
\endcode
*/
import QtQuick 2.0
Text {
- text: "The date is: " + Date().toLocaleDateString(Qt.locale("de_DE"))
+ text: "The date is: " + new Date().toLocaleDateString(Qt.locale("de_DE"))
}
\endcode
*/
import QtQuick 2.0
Text {
- text: "The date is: " + Date().toLocaleTimeString(Qt.locale("de_DE"))
+ text: "The date is: " + new Date().toLocaleTimeString(Qt.locale("de_DE"))
}
\endcode
*/