Skip to content

Commit 67beb3c

Browse files
committed
ui+sessions: improve when expiry label displays Never
1 parent d56c42c commit 67beb3c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/store/models/session.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ export default class Session {
6666

6767
/** The date this session will expire as formatted string */
6868
get expiryLabel() {
69-
return this.expiry.getTime() === MAX_DATE.getTime()
69+
// consider any expiry past the year 9000 to be never. This
70+
// factors in expiry values set in different time zones
71+
const minDate = new Date(MAX_DATE.getFullYear() - 999, 0, 1);
72+
return this.expiry.getTime() > minDate.getTime()
7073
? 'Never'
7174
: formatDate(this.expiry, 'MMM d, yyyy h:mm a');
7275
}

0 commit comments

Comments
 (0)