From 4a4dc2ec78e502137cd9616786c8939645276b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Tue, 22 Mar 2022 00:15:44 +0200 Subject: [PATCH] Dayjs --- src/lib/dialog/base-dialog.component.ts | 6 +++++- src/lib/utils/functions.ts | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib/dialog/base-dialog.component.ts b/src/lib/dialog/base-dialog.component.ts index 32d72d5..29b346a 100644 --- a/src/lib/dialog/base-dialog.component.ts +++ b/src/lib/dialog/base-dialog.component.ts @@ -28,7 +28,11 @@ export abstract class BaseDialogComponent extends AutoUnsubscribe implements OnI private readonly _dialogService: ConfirmationDialogService = this._injector.get(ConfirmationDialogService); private readonly _dialog: MatDialog = this._injector.get(MatDialog); - constructor(protected readonly _injector: Injector, protected readonly _dialogRef: MatDialogRef, private readonly _isInEditMode?: boolean) { + constructor( + protected readonly _injector: Injector, + protected readonly _dialogRef: MatDialogRef, + private readonly _isInEditMode?: boolean, + ) { super(); } diff --git a/src/lib/utils/functions.ts b/src/lib/utils/functions.ts index e26dd75..f497994 100644 --- a/src/lib/utils/functions.ts +++ b/src/lib/utils/functions.ts @@ -1,7 +1,7 @@ import { ITrackable } from '../listing/models/trackable'; -import moment from 'moment'; import { FormGroup } from '@angular/forms'; import { forOwn, has, isEqual, isPlainObject, transform } from 'lodash-es'; +import dayjs, { Dayjs } from 'dayjs'; export function capitalize(value: string): string { if (!value) { @@ -20,7 +20,7 @@ export function humanize(value: string, lowercase = true): string { } export function _log(value: unknown, message = '') { - console.log(`%c[${moment().format('HH:mm:ss.SSS')}] ${message}`, 'color: yellow;', value); + console.log(`%c[${dayjs().format('HH:mm:ss.SSS')}] ${message}`, 'color: yellow;', value); } export function toNumber(str: string): number { @@ -55,8 +55,8 @@ export function hasFormChanged(form: FormGroup, initialFormValue: Record