View Single Post
Posts: 10 | Thanked: 0 times | Joined on Jan 2014
#3
Originally Posted by coderus View Post
1. you declaring "date" role, but using "datum". wtf?
2. show your xml
Sorry my mistake. I set up my app in German and change the names to english when I posted the code. Forgot to change the second one as well. In my code that is correct, I use the same name.

[Update]
After a lot of try and error I found the mistake. Date alone was not enough, I had to create a new Date and multiply with 1000 since JavaScript expects milliseconds. Now the code works but I get UTC time. I deducted one hour but I guess that is not the correct way to do it. In case anybody knows how to do it correctly please let me know.

Code:
Label {
                id: labelArt
                text: Qt.formatDateTime( new Date(model.date*1000),"dd.mm.YY - hh:mm" ) +"  --  "
}

Last edited by No.User; 2014-01-24 at 17:30. Reason: Solved