@osovitny/anatoly 3.19.11 → 3.19.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import * as i1 from '@angular/common/http';
6
6
  import { HttpResponse, HttpClient, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
7
7
  import * as i1$1 from '@angular/common';
8
8
  import { DOCUMENT, CommonModule } from '@angular/common';
9
+ import { format, formatDistance, formatDistanceToNow } from 'date-fns';
9
10
  import js_beautify from 'js-beautify';
10
11
  import * as i1$2 from '@angular/router';
11
12
  import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
@@ -13,7 +14,6 @@ import { v4 } from 'uuid';
13
14
  import * as i4 from '@azure/msal-angular';
14
15
  import { MSAL_GUARD_CONFIG, MsalGuard, MsalInterceptor, MSAL_INTERCEPTOR_CONFIG, MSAL_INSTANCE, MsalService, MsalBroadcastService, MsalModule } from '@azure/msal-angular';
15
16
  import { BrowserUtils, EventType, InteractionStatus, InteractionType, InteractionRequiredAuthError, PromptValue, PublicClientApplication, LogLevel } from '@azure/msal-browser';
16
- import { format, formatDistance, formatDistanceToNow } from 'date-fns';
17
17
  import { enUS } from 'date-fns/locale/en-US';
18
18
  import * as i1$3 from '@ngx-translate/core';
19
19
  import { TranslateModule, TranslateLoader, TranslateService } from '@ngx-translate/core';
@@ -1260,19 +1260,23 @@ function isValidTimezoneIANAString(timeZoneString) {
1260
1260
  </file>
1261
1261
  */
1262
1262
  class DateConvert {
1263
- static toDate(argument) {
1264
- const argStr = Object.prototype.toString.call(argument);
1265
- if (argument instanceof Date || (typeof argument === "object" && argStr === "[object Date]")) {
1266
- return argument;
1263
+ static toDate(date) {
1264
+ const argStr = Object.prototype.toString.call(date);
1265
+ if (date instanceof Date || (typeof date === "object" && argStr === "[object Date]")) {
1266
+ return date;
1267
1267
  }
1268
- else if (typeof argument === "number" || argStr === "[object Number]" ||
1269
- typeof argument === "string" || argStr === "[object String]") {
1270
- return new Date(argument);
1268
+ else if (typeof date === "number" || argStr === "[object Number]" ||
1269
+ typeof date === "string" || argStr === "[object String]") {
1270
+ return new Date(date);
1271
1271
  }
1272
1272
  else {
1273
1273
  return new Date(NaN);
1274
1274
  }
1275
1275
  }
1276
+ static toFormattedDate(date, formatStr = 'yyyy-MM-dd HH:mm:ss') {
1277
+ const parsedDate = this.toDate(date);
1278
+ return format(parsedDate, formatStr);
1279
+ }
1276
1280
  static utcToLocal(dirtyDate) {
1277
1281
  if (typeof dirtyDate === 'string') {
1278
1282
  if (dirtyDate.indexOf("T") > -1) {
@@ -10447,7 +10451,6 @@ class AnatolyIAMPagesModule {
10447
10451
  static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyIAMPagesModule }); }
10448
10452
  static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
10449
10453
  RouterModule,
10450
- HttpClientModule,
10451
10454
  IAMRouterModule] }); }
10452
10455
  }
10453
10456
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnatolyIAMPagesModule, [{
@@ -10456,7 +10459,6 @@ class AnatolyIAMPagesModule {
10456
10459
  imports: [
10457
10460
  CommonModule,
10458
10461
  RouterModule,
10459
- HttpClientModule,
10460
10462
  IAMRouterModule
10461
10463
  ],
10462
10464
  exports: [],
@@ -10466,8 +10468,7 @@ class AnatolyIAMPagesModule {
10466
10468
  }]
10467
10469
  }], null, null); })();
10468
10470
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyIAMPagesModule, { declarations: [SignInPage, SignUpPage, SignOutPage], imports: [CommonModule,
10469
- RouterModule,
10470
- HttpClientModule, i1$2.RouterModule] }); })();
10471
+ RouterModule, i1$2.RouterModule] }); })();
10471
10472
 
10472
10473
  /*
10473
10474
  <file>