← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1482512] [NEW] setMonth() and other setXXX() javascript function doesn't work on the date QML object

 

Public bug reported:

>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

** Affects: qtdeclarative-opensource-src (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: devexp

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to qtdeclarative-opensource-src in
Ubuntu.
https://bugs.launchpad.net/bugs/1482512

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

Status in qtdeclarative-opensource-src package in Ubuntu:
  New

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1482512/+subscriptions