From 8b93b7a3f264bdfef01ce7e168d4957db743a116 Mon Sep 17 00:00:00 2001 From: Pawel Andruszkiewicz Date: Fri, 23 Jan 2015 15:16:47 +0100 Subject: [PATCH] [Messaging] Properly convert timestamp to JS Date. [Validation] TCT MessageStorage_findMessages_filter_timestamp_valid passes. TCT MessageStorage_mms_findConversations_filter_timestamp passes. Change-Id: Id97d8dfbe4ff7caef7d26c0098085f3596fa0d3a Signed-off-by: Pawel Andruszkiewicz --- src/messaging/messaging_api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/messaging/messaging_api.js b/src/messaging/messaging_api.js index 716ec572..8e7a6739 100644 --- a/src/messaging/messaging_api.js +++ b/src/messaging/messaging_api.js @@ -247,7 +247,7 @@ function Message(type, data) { 'timestamp', { get: function () { - return _internal.timestamp ? new Date(_internal.timestamp) : _internal.timestamp; + return _internal.timestamp ? new Date(_internal.timestamp * 1000) : _internal.timestamp; }, set: function (value) { if (value instanceof InternalValues_) { @@ -1342,7 +1342,7 @@ MessageStorage.prototype.removeChangeListener = function () { function MessageConversation(data) { propertyFactory_(this, 'id' , data.id || null , Property.E); propertyFactory_(this, 'type' , data.type || '' , Property.E); - propertyFactory_(this, 'timestamp' , data.timestamp || null , Property.E); + propertyFactory_(this, 'timestamp' , data.timestamp ? new Date(data.timestamp * 1000) : null , Property.E); propertyFactory_(this, 'messageCount' , data.messageCount || 0 , Property.E); propertyFactory_(this, 'unreadMessages', data.unreadMessages || 0 , Property.E); propertyFactory_(this, 'preview' , data.preview || '' , Property.E); -- 2.34.1