setMonth() and other setXXX() javascript function doesn't work on the date QML object

Bug #1482512 reported by Didier Roche-Tolomelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qtdeclarative-opensource-src (Ubuntu)
New
Undecided
Unassigned

Bug Description

From http://doc.qt.io/qt-5/qml-qtqml-date.html, "The QML Date object extends the JS Date object with locale aware functions.".

Some of them indeed works, like getMonth(), getDate(), returning expected value.

However, when change a date property on a object with setMonth() and other functions, they don't do anything (and worse, fails silently):

Item {
  id: foo
  property date currentDate
}

foo.currentDate having no databinding.

On a click event handler:
console.log("Before setMonth " + foo.currentDate);
currentDate.setMonth(4);
console.log("After setMonth " + foo.currentDate);

returns:
Before setMonth Sat Mar 7 08:13:50 2015 GMT+0100
After setMonth Sat Mar 7 08:13:50 2015 GMT+0100

The date has been unchanged

Tags: devexp
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.