This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
FoodLoop-Web/src/app/shared/transaction-result.component.ts

24 lines
629 B
TypeScript
Raw Normal View History

import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import * as moment from 'moment';
interface TransactionData {
seller: number;
2017-09-19 17:22:19 +01:00
value: number;
purchase_time: string;
}
@Component({
// tslint:disable-next-line
selector: '[transaction-result]',
templateUrl: 'transaction-result.component.html',
})
export class TransactionResultComponent implements OnInit {
@Input() public transaction: TransactionData;
2019-07-12 20:47:01 +01:00
@Input() public showMeta: boolean;
public transactionDate: string;
ngOnInit(): void {
this.transactionDate = moment(this.transaction.purchase_time).format('llll');
}
}