diff options
Diffstat (limited to 'gui/src/renderer/lib')
| -rw-r--r-- | gui/src/renderer/lib/account-expiry.ts | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/gui/src/renderer/lib/account-expiry.ts b/gui/src/renderer/lib/account-expiry.ts deleted file mode 100644 index 5393238dcd..0000000000 --- a/gui/src/renderer/lib/account-expiry.ts +++ /dev/null @@ -1,35 +0,0 @@ -import moment from 'moment'; -import { sprintf } from 'sprintf-js'; -import { messages } from '../../shared/gettext'; - -export default class AccountExpiry { - private expiry: moment.Moment; - - constructor(isoString: string, locale: string) { - this.expiry = moment(isoString).locale(locale); - } - - public hasExpired(): boolean { - return this.willHaveExpiredAt(new Date()); - } - - public willHaveExpiredAt(date: Date): boolean { - return this.expiry.isSameOrBefore(date); - } - - public formattedDate(): string { - return this.expiry.format('L LTS'); - } - - public remainingTime(): string { - const duration = this.expiry.fromNow(true); - - return sprintf( - // TRANSLATORS: The remaining time left on the account displayed across the app. - // TRANSLATORS: Available placeholders: - // TRANSLATORS: %(duration)s - a localized remaining time (in minutes, hours, or days) until the account expiry - messages.pgettext('account-expiry', '%(duration)s left'), - { duration }, - ); - } -} |
