diff --git a/static/js/directives/ui/expiration-status-view/expiration-status-view.component.ts b/static/js/directives/ui/expiration-status-view/expiration-status-view.component.ts index e3a5bd4a6..21092b951 100644 --- a/static/js/directives/ui/expiration-status-view/expiration-status-view.component.ts +++ b/static/js/directives/ui/expiration-status-view/expiration-status-view.component.ts @@ -2,6 +2,11 @@ import { Input, Component, Inject } from 'ng-metadata/core'; import * as moment from "moment"; import './expiration-status-view.component.css'; +type expirationInfo = { + className: string; + icon: string; +}; + /** * A component that displays expiration status. */ @@ -12,12 +17,12 @@ import './expiration-status-view.component.css'; export class ExpirationStatusViewComponent { @Input('<') public expirationDate: Date; - private getExpirationInfo(expirationDate): any { + private getExpirationInfo(expirationDate): expirationInfo|null { if (!expirationDate) { - return ''; + return null; } - var expiration = moment(expirationDate); + const expiration = moment(expirationDate); if (moment().isAfter(expiration)) { return {'className': 'expired', 'icon': 'fa-warning'}; } @@ -32,4 +37,4 @@ export class ExpirationStatusViewComponent { return {'className': 'info', 'icon': 'fa-clock-o'}; } -} \ No newline at end of file +}