@wavemaker/app-ng-runtime 11.5.1-rc.5402 → 11.5.1-rc.5413

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.
@@ -2374,25 +2374,32 @@ TrailingZeroDecimalPipe.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "traili
2374
2374
  }]
2375
2375
  }], function () { return [{ type: i1$1.DecimalPipe }]; }, null); })();
2376
2376
  class ToDatePipe extends WmPipe {
2377
- transform(data, format, timezone, compInstance) {
2377
+ // This method calls the custom formatter fn after applying the exisitng date pattern
2378
+ returnFn(data, args) {
2378
2379
  if (this.isCustomPipe) {
2379
- return this.customFormatter(data, arguments);
2380
+ if (args) {
2381
+ args[0] = data;
2382
+ }
2383
+ return this.customFormatter(data, args);
2380
2384
  }
2385
+ return data;
2386
+ }
2387
+ transform(data, format, timezone, compInstance) {
2381
2388
  let timestamp;
2382
2389
  // 'null' is to be treated as a special case, If user wants to enter null value, empty string will be passed to the backend
2383
2390
  if (data === 'null' || data === '') {
2384
- return '';
2391
+ return this.returnFn('', arguments);
2385
2392
  }
2386
2393
  if (!isDefined(data)) {
2387
- return '';
2394
+ return this.returnFn('', arguments);
2388
2395
  }
2389
2396
  timestamp = getEpochValue(data);
2390
2397
  if (timestamp) {
2391
2398
  if (format === 'timestamp') {
2392
- return timestamp;
2399
+ return this.returnFn(timestamp, arguments);
2393
2400
  }
2394
2401
  if (format === 'UTC') {
2395
- return new Date(timestamp).toISOString();
2402
+ return this.returnFn(new Date(timestamp).toISOString(), arguments);
2396
2403
  }
2397
2404
  let formattedVal;
2398
2405
  const timeZone = this.i18nService ? this.i18nService.getTimezone(compInstance) : timezone;
@@ -2402,9 +2409,9 @@ class ToDatePipe extends WmPipe {
2402
2409
  else {
2403
2410
  formattedVal = this.datePipe.transform(timestamp, format);
2404
2411
  }
2405
- return formattedVal;
2412
+ return this.returnFn(formattedVal, arguments);
2406
2413
  }
2407
- return '';
2414
+ return this.returnFn('', arguments);
2408
2415
  }
2409
2416
  constructor(datePipe, i18nService, customPipeManager) {
2410
2417
  super('toDate', customPipeManager);