Commit 0c7387f8 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Linphone/Chat): format correcly sections

parent 5f4e3cf3
...@@ -21,10 +21,10 @@ QVariant ChatModel::data (const QModelIndex &index, int role) const { ...@@ -21,10 +21,10 @@ QVariant ChatModel::data (const QModelIndex &index, int role) const {
return QVariant(); return QVariant();
switch (role) { switch (role) {
case: Roles::ChatEntry case Roles::ChatEntry:
return QVariant::fromValue(m_entries[row]); return QVariant::fromValue(m_entries[row]);
case: Roles::SectionDate case Roles::SectionDate:
return QVariant::fromValue(m_entries[row]["sectionDate"]); return QVariant::fromValue(m_entries[row]["timestamp"].toDate());
} }
return QVariant(); return QVariant();
...@@ -58,7 +58,7 @@ void ChatModel::setSipAddress (const QString &sip_address) { ...@@ -58,7 +58,7 @@ void ChatModel::setSipAddress (const QString &sip_address) {
for (auto &message : chat_room->getHistory(0)) { for (auto &message : chat_room->getHistory(0)) {
QVariantMap map; QVariantMap map;
map["sectionDate"] = 1465389121; // UTC format.
map["timestamp"] = QDateTime::fromTime_t(message->getTime()); map["timestamp"] = QDateTime::fromTime_t(message->getTime());
map["type"] = "message"; map["type"] = "message";
map["content"] = Utils::linphoneStringToQString( map["content"] = Utils::linphoneStringToQString(
......
...@@ -65,7 +65,7 @@ ColumnLayout { ...@@ -65,7 +65,7 @@ ColumnLayout {
// Cast section to integer because Qt converts the // Cast section to integer because Qt converts the
// sectionDate in string!!! // sectionDate in string!!!
text: new Date(+section).toLocaleDateString( text: new Date(section).toLocaleDateString(
Qt.locale(App.locale()) Qt.locale(App.locale())
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment