- const monthsArr: string[] = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
- const date: Date = new Date(unixtimestamp * this.epochTime1000);
- const year: number = date.getFullYear();
- const month: string = monthsArr[date.getMonth()];
- const day: number = date.getDate();
- const hours: number = date.getHours();
- const minutes: string = '0' + date.getMinutes();
- const seconds: string = '0' + date.getSeconds();
- return month + '-' + day + '-' + year + ' ' + hours + ':' + minutes.substr(this.epochTimeMinus2) + ':'
- + seconds.substr(this.epochTimeMinus2);
+ if (!isNullOrUndefined(unixtimestamp)) {
+ const monthsArr: string[] = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+ const date: Date = new Date(unixtimestamp * this.epochTime1000);
+ const year: number = date.getFullYear();
+ const month: string = monthsArr[date.getMonth()];
+ const day: number = date.getDate();
+ const hours: number = date.getHours();
+ const minutes: string = '0' + date.getMinutes();
+ const seconds: string = '0' + date.getSeconds();
+ return month + '-' + day + '-' + year + ' ' + hours + ':' + minutes.substr(this.epochTimeMinus2) + ':'
+ + seconds.substr(this.epochTimeMinus2);
+ }
+ return this.translateService.instant('NODATE');