From: Pawel Andruszkiewicz
Date: Fri, 23 Jan 2015 14:16:47 +0000 (+0100)
Subject: [Messaging] Properly convert timestamp to JS Date.
X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~568
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b93b7a3f264bdfef01ce7e168d4957db743a116;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[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
---
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);