Commit 9d69d361fceb8b3d55866f97669cb48ea40cf468

Authored by Adhidarma Hadiwinoto
1 parent b56e7b1fa4
Exists in master

momentFormat

Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff

1 1 'use strict';
2 2  
3 3 var moment = require('moment');
  4 +var momentFormat = 'YYYY-MM-DD HH:mm:ss';
4 5  
5 6 module.exports = MatrixUtil;
6 7  
... ... @@ -67,7 +68,7 @@ MatrixUtil.prototype.updateBuddyState = function(jid, state, statusText, resourc
67 68 matrix.buddies[jid]['resources'][resource] = {
68 69 state: state,
69 70 statusText: statusText,
70   - last_update: moment().format('YYYY-MM-DD HH:mm:ss')
  71 + last_update: moment().format(momentFormat)
71 72 }
72 73 }
73 74 catch(e) {
... ... @@ -142,7 +143,8 @@ MatrixUtil.prototype._updateLastMessage = function(partner, msg, direction) {
142 143  
143 144 matrix.buddies[partner]['last_' + direction] = {
144 145 msg: msg,
145   - last_update: moment().format('YYYY-MM-DD HH:mm:ss')
  146 + last_update: moment().format(momentFormat),
  147 + last_update_ts: Date.now()
146 148 }
147 149 }
148 150