Skip to content

Commit

Permalink
chore: update to dates displayed in cronjob card (#18)
Browse files Browse the repository at this point in the history
Signed-off-by: SlavomirMazurPantheon <[email protected]>

Signed-off-by: SlavomirMazurPantheon <[email protected]>
  • Loading branch information
SlavomirMazurPantheon authored Jan 16, 2023
1 parent 8f5a392 commit f458ef2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
<mat-card-content>
<mat-spinner *ngIf="isLoading; else card" class="mx-auto"></mat-spinner>
<ng-template #card>
<div>
<div *ngIf="startDate">
<b>Start:</b>&nbsp;
<span>{{ startDate | date:'MMM d, y, H:mm':'UTC' }} UTC</span>
</div>
<div>
<div *ngIf="endDate">
<b>End:</b>&nbsp;
<span>{{ endDate | date:'MMM d, y, H:mm':'UTC' }} UTC</span>
<span>{{ endDate | date:'MMM d, y, H:mm':'UTC' }} UTC</span>
</div>
<div *ngIf="lastSuccessfullDate">
<b>Last successfull:</b>&nbsp;
<span>{{ lastSuccessfullDate | date:'MMM d, y, H:mm':'UTC' }} UTC</span>
<span>{{ lastSuccessfullDate | date:'MMM d, y, H:mm':'UTC' }} UTC</span>
</div>
</ng-template>
</mat-card-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export class CronjobCardComponent implements OnInit {

ngOnInit(): void {
this.status = this.cronjobData.status;
this.startDate = new Date(this.cronjobData.start * 1000);
this.endDate = new Date(this.cronjobData.end * 1000);
this.startDate = this.cronjobData['start'] ? new Date(this.cronjobData['start'] * 1000) : null;
this.endDate = this.cronjobData['end'] ? new Date(this.cronjobData['end'] * 1000) : null;
this.lastSuccessfullDate = this.cronjobData['last_successfull'] ? new Date(this.cronjobData['last_successfull'] * 1000) : null;
this.errorMessage = this.cronjobData.error;
this.infoMessages = this.cronjobData.messages;
Expand Down

0 comments on commit f458ef2

Please sign in to comment.