Browse Source

Refactor date formatting in helper module by removing DEFAULT_FORMAT and updating to DATE_FORMAT

pull/4906/head
Diego Noah 2 weeks ago
committed by Thomas Kaul
parent
commit
cacdad4474
  1. 1
      libs/common/src/lib/helper.ts
  2. 4
      libs/ui/src/lib/account-balances/account-balances.component.ts

1
libs/common/src/lib/helper.ts

@ -23,7 +23,6 @@ import { AssetProfileIdentifier, Benchmark } from './interfaces';
import { BenchmarkTrend, ColorScheme } from './types'; import { BenchmarkTrend, ColorScheme } from './types';
export const DATE_FORMAT = 'yyyy-MM-dd'; export const DATE_FORMAT = 'yyyy-MM-dd';
export const DEFAULT_FORMAT = 'yyyy-MM-dd';
export const DATE_FORMAT_MONTHLY = 'MMMM yyyy'; export const DATE_FORMAT_MONTHLY = 'MMMM yyyy';
export const DATE_FORMAT_YEARLY = 'yyyy'; export const DATE_FORMAT_YEARLY = 'yyyy';

4
libs/ui/src/lib/account-balances/account-balances.component.ts

@ -2,7 +2,7 @@ import { CreateAccountBalanceDto } from '@ghostfolio/api/app/account-balance/cre
import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type'; import { ConfirmationDialogType } from '@ghostfolio/client/core/notification/confirmation-dialog/confirmation-dialog.type';
import { NotificationService } from '@ghostfolio/client/core/notification/notification.service'; import { NotificationService } from '@ghostfolio/client/core/notification/notification.service';
import { validateObjectForForm } from '@ghostfolio/client/util/form.util'; import { validateObjectForForm } from '@ghostfolio/client/util/form.util';
import { DEFAULT_FORMAT, getLocale } from '@ghostfolio/common/helper'; import { DATE_FORMAT, getLocale } from '@ghostfolio/common/helper';
import { AccountBalancesResponse } from '@ghostfolio/common/interfaces'; import { AccountBalancesResponse } from '@ghostfolio/common/interfaces';
import { import {
@ -115,7 +115,7 @@ export class GfAccountBalancesComponent
const accountBalance: CreateAccountBalanceDto = { const accountBalance: CreateAccountBalanceDto = {
accountId: this.accountId, accountId: this.accountId,
balance: this.accountBalanceForm.get('balance').value, balance: this.accountBalanceForm.get('balance').value,
date: format(this.accountBalanceForm.get('date').value, DEFAULT_FORMAT) date: format(this.accountBalanceForm.get('date').value, DATE_FORMAT)
}; };
try { try {

Loading…
Cancel
Save