Add Invite.expiresAt/expiresTimestamp

This commit is contained in:
Schuyler Cebulskie
2016-09-27 19:50:03 -04:00
parent 1e57c968dd
commit 1a3f5ca6a9
2 changed files with 19 additions and 1 deletions

View File

@@ -108,6 +108,24 @@ class Invite {
return new Date(this.createdTimestamp);
}
/**
* The timestamp the invite will expire at
* @type {number}
* @readonly
*/
get expiresTimestamp() {
return this.createdTimestamp + (this.maxAge * 1000);
}
/**
* The time the invite will expire
* @type {Date}
* @readonly
*/
get expiresAt() {
return new Date(this.expiresTimestamp);
}
/**
* The URL to the invite
* @type {string}