Merge pull request #10 from nicdex/8-fix-creation-time

using toNumber instead of toInt fixes the creation time issue
This commit is contained in:
Nicolas Dextraze 2016-11-06 16:24:24 -08:00 committed by GitHub
commit 14a05606ab

View File

@ -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}