@veloceapps/sdk 8.0.0-88 → 8.0.0-89

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, NgModule, inject, Directive, Input, LOCALE_ID, Pipe } from '@angular/core';
3
- import { UUID, ConfigurationContextMode, ConfigurationContext, ChargeGroupUtils, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationMode, ConfigurationTranslatorUtils, RuntimeModel, isNotLegacyUIDefinition, SalesforceIdUtils, EntityUtil, formatNumber } from '@veloceapps/core';
3
+ import { UUID, ConfigurationContextMode, ConfigurationContext, ChargeGroupUtils, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationMode, ConfigurationTranslatorUtils, RuntimeModel, isNotLegacyUIDefinition, SalesforceIdUtils, EntityUtil, DEFAULT_TIME_FORMAT, formatNumber } from '@veloceapps/core';
4
4
  import { BehaviorSubject, zip, noop, combineLatest, map as map$2, tap as tap$1, throwError, shareReplay as shareReplay$1, of, switchMap as switchMap$1, catchError as catchError$1, Subject, take as take$1, distinctUntilChanged } from 'rxjs';
5
5
  import { map, filter, tap, switchMap, skip, take, shareReplay, catchError, finalize, first } from 'rxjs/operators';
6
6
  import * as i1 from '@veloceapps/api';
@@ -1685,13 +1685,19 @@ class DatePipe {
1685
1685
  this.destroy$.next();
1686
1686
  this.destroy$.complete();
1687
1687
  }
1688
- transform(date) {
1688
+ transform(date, type = 'date') {
1689
1689
  var _a, _b;
1690
1690
  if (!date) {
1691
1691
  return '';
1692
1692
  }
1693
+ const dateFormat = ((_a = this.formattingSettings) === null || _a === void 0 ? void 0 : _a.dateFormats.datePipeFormat) || DEFAULT_DATE_FORMAT;
1694
+ const formatMap = {
1695
+ date: dateFormat,
1696
+ time: DEFAULT_TIME_FORMAT,
1697
+ datetime: `${dateFormat} ${DEFAULT_TIME_FORMAT}`,
1698
+ };
1693
1699
  try {
1694
- return formatDate(date, ((_a = this.formattingSettings) === null || _a === void 0 ? void 0 : _a.dateFormats.datePipeFormat) || DEFAULT_DATE_FORMAT, this.locale, (_b = this.defaultOptions) === null || _b === void 0 ? void 0 : _b.timezone);
1700
+ return formatDate(date, formatMap[type], this.locale, (_b = this.defaultOptions) === null || _b === void 0 ? void 0 : _b.timezone);
1695
1701
  }
1696
1702
  catch (error) {
1697
1703
  return new Date(date).toString();