fix(Activity): ensure that timestamps are actually numbers

Fixes #2364
Discord sends those timestamps packed as SMALL_BIG_EXT, which get converted to strings in js.
~~Maybe they are already preparing their timestamps for 2038.~~
This commit is contained in:
Pascal
2018-02-28 09:31:42 +01:00
parent 9f8925226d
commit 464fc14edd

View File

@@ -108,8 +108,8 @@ class Activity {
* @prop {?Date} end When the activity will end * @prop {?Date} end When the activity will end
*/ */
this.timestamps = data.timestamps ? { this.timestamps = data.timestamps ? {
start: data.timestamps.start ? new Date(data.timestamps.start) : null, start: data.timestamps.start ? new Date(Number(data.timestamps.start)) : null,
end: data.timestamps.end ? new Date(data.timestamps.end) : null, end: data.timestamps.end ? new Date(Number(data.timestamps.end)) : null,
} : null; } : null;
/** /**