Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
treike
Posts: 18
Registered: ‎09-26-2012
My Device: Developer
My Carrier: T-Mobile
Accepted Solution

Format a SQLite DateTime in QML

Hello everyone,

 

I am sorry if this is an easy/stupid question. But I can't get the date object retrieved from a SQLite DB formatted properly.

 

I've found the TwitterTimeline example, but they just output the whole thing. I want to format it like dd.mm.YYYY in my ListView.

 

I've thought I could Javascript standards like this:

 

StandardListItem {
  reserveImageSpace: false
  title: {
    ListItemData.sys+" : "+ListItemData.dia
  }
  status:{ (new Date(ListItemData.measure_date)).getFullYear(); }
}

 

 

and the toString() methods and so on, but I only retrieve "nan" outputs.

 

Then I tried without the "new Date()" conversion, b/c maybe it is already converted to a new date, but get no output.

 

Can anybody help me on this? I am quite new to BB 10/Cascades, but really love using it.

 

Thanks a lot!

Please use plain text.
Developer
treike
Posts: 18
Registered: ‎09-26-2012
My Device: Developer
My Carrier: T-Mobile

Re: Format a SQLite DateTime in QML

So, is it not possible to format the DateTime in QML?

Please use plain text.
Developer
treike
Posts: 18
Registered: ‎09-26-2012
My Device: Developer
My Carrier: T-Mobile

Re: Format a SQLite DateTime in QML

So, it seems to me that the part in the QML there is not Javascript, at least it seems that Date-functions do not work.

 

So I took another way and made my custom objects, filling a GroupDataModel from SQL with these custom objects and inside the custom objects I perform the date formatting.

 

Maybe this helps somebody else, too.

Please use plain text.