From ed65fc87427ff009c7274ddfdd0e407e7a12b40d Mon Sep 17 00:00:00 2001 From: Nicolas Dextraze Date: Sun, 6 Nov 2016 16:14:40 -0800 Subject: [PATCH] using toNumber instead of toInt fixes the creation time issue --- src/results.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/results.js b/src/results.js index ddaab5c..5f970ab 100644 --- a/src/results.js +++ b/src/results.js @@ -65,8 +65,8 @@ function RecordedEvent(ev) { eventNumber: {enumerable: true, value: ev.event_number}, eventType: {enumerable: true, value: ev.event_type}, //Javascript doesn't have .Net precision for time, so we use created_epoch for created - created: {enumerable: true, value: new Date(ev.created_epoch ? ev.created_epoch.toInt() : 0)}, - createdEpoch: {enumerable: true, value: ev.created_epoch ? ev.created_epoch.toInt() : 0}, + created: {enumerable: true, value: new Date(ev.created_epoch ? ev.created_epoch.toNumber() : 0)}, + createdEpoch: {enumerable: true, value: ev.created_epoch ? ev.created_epoch.toNumber() : 0}, data: {enumerable: true, value: ev.data ? ev.data.toBuffer() : new Buffer(0)}, metadata: {enumerable: true, value: ev.metadata ? ev.metadata.toBuffer() : new Buffer(0)}, isJson: {enumerable: true, value: ev.data_content_type === 1}