[Messaging] Properly convert timestamp to JS Date.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Fri, 23 Jan 2015 14:16:47 +0000 (15:16 +0100)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Fri, 23 Jan 2015 14:39:56 +0000 (15:39 +0100)
[Validation] TCT MessageStorage_findMessages_filter_timestamp_valid passes.
             TCT MessageStorage_mms_findConversations_filter_timestamp passes.

Change-Id: Id97d8dfbe4ff7caef7d26c0098085f3596fa0d3a
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/messaging/messaging_api.js

index 716ec572f9efc2c37623822595dc3ff042c56878..8e7a67398049378ef006a41ef04cf26d0c72e0ec 100644 (file)
@@ -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);