Fix linter errors for transaction-log component
This commit is contained in:
parent
662d6be5c9
commit
0907134ff7
1 changed files with 11 additions and 10 deletions
|
@ -12,12 +12,13 @@ import 'rxjs/add/operator/map';
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: 'transaction-log.component.html',
|
templateUrl: 'transaction-log.component.html',
|
||||||
})
|
})
|
||||||
export class TransactionLogComponent {
|
export class TransactionLogComponent implements OnInit {
|
||||||
|
|
||||||
transactionList;
|
transactionList;
|
||||||
noTransactionList = true;
|
noTransactionList = true;
|
||||||
myDate: any;
|
myDate: any;
|
||||||
minDate: any;
|
minDate: any;
|
||||||
|
public p: any;
|
||||||
|
|
||||||
public paginateConfig: PaginationInstance = {
|
public paginateConfig: PaginationInstance = {
|
||||||
id: 'transpaginate',
|
id: 'transpaginate',
|
||||||
|
@ -28,8 +29,8 @@ export class TransactionLogComponent {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: Http,
|
private http: Http,
|
||||||
private api: ApiService,
|
private api: ApiService,
|
||||||
) {
|
) {
|
||||||
this.myDate = moment().format('YYYY-MM-DD[T]HH:mm');
|
this.myDate = moment().format('YYYY-MM-DD[T]HH:mm');
|
||||||
// this.myDate = new Date().toISOString().slice(0, 16);
|
// this.myDate = new Date().toISOString().slice(0, 16);
|
||||||
}
|
}
|
||||||
|
@ -39,13 +40,13 @@ export class TransactionLogComponent {
|
||||||
this.loadTransactions(1);
|
this.loadTransactions(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
getMinDate(){
|
getMinDate() {
|
||||||
// gets the April 1st date of the current year
|
// gets the April 1st date of the current year
|
||||||
let aprilDate = moment().month(3).date(1);
|
const aprilDate = moment().month(3).date(1);
|
||||||
let now = moment();
|
const now = moment();
|
||||||
// Checks if current time is before April 1st, if so returns true
|
// Checks if current time is before April 1st, if so returns true
|
||||||
let beforeApril = now.isBefore(aprilDate);
|
const beforeApril = now.isBefore(aprilDate);
|
||||||
if ( beforeApril == true ) {
|
if ( beforeApril === true ) {
|
||||||
this.minDate = aprilDate.subtract(2, 'years').format('YYYY-MM-DD');
|
this.minDate = aprilDate.subtract(2, 'years').format('YYYY-MM-DD');
|
||||||
} else {
|
} else {
|
||||||
this.minDate = aprilDate.subtract(1, 'years').format('YYYY-MM-DD');
|
this.minDate = aprilDate.subtract(1, 'years').format('YYYY-MM-DD');
|
||||||
|
@ -56,9 +57,9 @@ export class TransactionLogComponent {
|
||||||
console.log(logPage);
|
console.log(logPage);
|
||||||
this.api.transList(logPage).subscribe(
|
this.api.transList(logPage).subscribe(
|
||||||
result => {
|
result => {
|
||||||
if(result.transactions.length > 0) {
|
if (result.transactions.length > 0) {
|
||||||
this.transactionList = result.transactions;
|
this.transactionList = result.transactions;
|
||||||
//TODO Rename in server
|
// TODO Rename in server
|
||||||
this.paginateConfig.totalItems = result.page_no;
|
this.paginateConfig.totalItems = result.page_no;
|
||||||
this.paginateConfig.currentPage = logPage;
|
this.paginateConfig.currentPage = logPage;
|
||||||
this.noTransactionList = false;
|
this.noTransactionList = false;
|
||||||
|
|
Reference in a new issue