feat(Linphone/Chat): format correcly sections

This commit is contained in:
Ronan Abhamon 2016-11-24 17:26:04 +01:00
parent 5f4e3cf350
commit 0c7387f84f
2 changed files with 5 additions and 5 deletions

View file

@ -21,10 +21,10 @@ QVariant ChatModel::data (const QModelIndex &index, int role) const {
return QVariant();
switch (role) {
case: Roles::ChatEntry
case Roles::ChatEntry:
return QVariant::fromValue(m_entries[row]);
case: Roles::SectionDate
return QVariant::fromValue(m_entries[row]["sectionDate"]);
case Roles::SectionDate:
return QVariant::fromValue(m_entries[row]["timestamp"].toDate());
}
return QVariant();
@ -58,7 +58,7 @@ void ChatModel::setSipAddress (const QString &sip_address) {
for (auto &message : chat_room->getHistory(0)) {
QVariantMap map;
map["sectionDate"] = 1465389121;
// UTC format.
map["timestamp"] = QDateTime::fromTime_t(message->getTime());
map["type"] = "message";
map["content"] = Utils::linphoneStringToQString(

View file

@ -65,7 +65,7 @@ ColumnLayout {
// Cast section to integer because Qt converts the
// sectionDate in string!!!
text: new Date(+section).toLocaleDateString(
text: new Date(section).toLocaleDateString(
Qt.locale(App.locale())
)
}