@acorex/core 20.1.18 → 20.1.19

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.
@@ -278,7 +278,7 @@ declare class AXTimeDurationFormatter implements AXFormatter {
278
278
  get name(): string;
279
279
  format(value: number, options?: AXTimeDurationFormatterOptions): string;
280
280
  translationService: AXTranslationService;
281
- millisecondsToMask(ms: number, startUnit?: AXTimeDurationUnit, endUnit?: AXTimeDurationUnit): Promise<string>;
281
+ millisecondsToMask(ms: number, startUnit?: AXTimeDurationUnit, endUnit?: AXTimeDurationUnit, label?: boolean): Promise<string>;
282
282
  static ɵfac: i0.ɵɵFactoryDeclaration<AXTimeDurationFormatter, never>;
283
283
  static ɵprov: i0.ɵɵInjectableDeclaration<AXTimeDurationFormatter>;
284
284
  }
@@ -1424,7 +1424,7 @@ class AXTimeDurationFormatter {
1424
1424
  // Join the parts according to the format
1425
1425
  return formattedTime.join(format.includes('ms') || format.includes('MS') ? ':' : ':');
1426
1426
  }
1427
- async millisecondsToMask(ms, startUnit = 'YEAR', endUnit = 'MILLISECOND') {
1427
+ async millisecondsToMask(ms, startUnit = 'YEAR', endUnit = 'MILLISECOND', label = false) {
1428
1428
  if (ms <= 0)
1429
1429
  return '';
1430
1430
  const translations = await Promise.all([
@@ -1459,26 +1459,31 @@ class AXTimeDurationFormatter {
1459
1459
  // Special handling for milliseconds (3 digits)
1460
1460
  if (unit.key === 'MILLISECOND') {
1461
1461
  if (count < 10) {
1462
- return `00${count} (${unit.label})`;
1462
+ return label ? `00${count} (${unit.label})` : `00${count}`;
1463
1463
  }
1464
1464
  else if (count < 100) {
1465
- return `0${count} (${unit.label})`;
1465
+ return label ? `0${count} (${unit.label})` : `0${count}`;
1466
1466
  }
1467
1467
  else {
1468
- return `${count} (${unit.label})`;
1468
+ return label ? `${count} (${unit.label})` : `${count}`;
1469
1469
  }
1470
1470
  }
1471
1471
  else {
1472
1472
  // For other units, pad with one zero if less than 10
1473
1473
  const paddedCount = count < 10 ? `0${count}` : `${count}`;
1474
- return `${paddedCount} (${unit.label})`;
1474
+ return label ? `${paddedCount} (${unit.label})` : `${paddedCount}`;
1475
1475
  }
1476
1476
  });
1477
- if (this.translationService.getActiveLang() === 'fa-IR') {
1478
- return result.reverse().join(' : ');
1477
+ if (label) {
1478
+ if (this.translationService.getActiveLang() === 'fa-IR') {
1479
+ return result.reverse().join(' : ');
1480
+ }
1481
+ else {
1482
+ return result.join(' : ');
1483
+ }
1479
1484
  }
1480
1485
  else {
1481
- return result.join(' : ');
1486
+ return result.join(':');
1482
1487
  }
1483
1488
  }
1484
1489
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: AXTimeDurationFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }