mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat: cashflow tranasction date format
This commit is contained in:
@@ -7,7 +7,12 @@ export class CashflowTransactionTransformer extends Transformer {
|
||||
* @returns {string[]}
|
||||
*/
|
||||
public includeAttributes = (): string[] => {
|
||||
return ['formattedAmount', 'transactionTypeFormatted'];
|
||||
return [
|
||||
'formattedAmount',
|
||||
'transactionTypeFormatted',
|
||||
'formattedDate',
|
||||
'formattedCreatedAt',
|
||||
];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -24,10 +29,28 @@ export class CashflowTransactionTransformer extends Transformer {
|
||||
|
||||
/**
|
||||
* Formatted transaction type.
|
||||
* @param transaction
|
||||
* @param transaction
|
||||
* @returns {string}
|
||||
*/
|
||||
protected transactionTypeFormatted = (transaction) => {
|
||||
return this.context.i18n.__(transaction.transactionTypeFormatted);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve the formatted transaction date.
|
||||
* @param invoice
|
||||
* @returns {string}
|
||||
*/
|
||||
protected formattedDate = (invoice): string => {
|
||||
return this.formatDate(invoice.date);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve the formatted created at date.
|
||||
* @param invoice
|
||||
* @returns {string}
|
||||
*/
|
||||
protected formattedCreatedAt = (invoice): string => {
|
||||
return this.formatDate(invoice.createdAt);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ export default class OrganizationService {
|
||||
): IOrganizationBuildDTO {
|
||||
return {
|
||||
...buildDTO,
|
||||
dateFormat: defaultTo(buildDTO.dateFormat, 'DD/MM/yyyy'),
|
||||
dateFormat: defaultTo(buildDTO.dateFormat, 'DD MMM yyyy'),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user