@servicemind.tis/tis-smart-table-viewer 2.4.15 → 2.4.16

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.
@@ -1790,21 +1790,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
1790
1790
  class TisDatePipe {
1791
1791
  transform(value, format) {
1792
1792
  const fmt = format || 'dd MMM yyyy';
1793
- if (typeof value == 'string' && value !== '') {
1794
- return DateTime.fromMillis(+value).toFormat(fmt);
1793
+ // Empty / "no date" inputs render blank (0 and "0" are treated as no-date).
1794
+ if (value === null || value === undefined || value === '' || value === 0 || value === '0') {
1795
+ return '';
1795
1796
  }
1796
- else if (typeof value == 'number') {
1797
- return DateTime.fromMillis(value).toFormat(fmt);
1797
+ let dt;
1798
+ if (value instanceof Date) {
1799
+ dt = DateTime.fromJSDate(value);
1798
1800
  }
1799
- else if (value instanceof Date) {
1800
- return DateTime.fromJSDate(value).toFormat(fmt);
1801
+ else if (typeof value === 'number') {
1802
+ dt = DateTime.fromMillis(value);
1801
1803
  }
1802
- else if (value === null || value === undefined) {
1803
- return '';
1804
+ else if (typeof value === 'string') {
1805
+ const num = Number(value);
1806
+ // Numeric string => epoch millis (unchanged); non-numeric => ISO date.
1807
+ dt = !isNaN(num) ? DateTime.fromMillis(num) : DateTime.fromISO(value);
1804
1808
  }
1805
1809
  else {
1806
- return 'Invalid Date';
1810
+ return '';
1807
1811
  }
1812
+ // Invalid inputs render blank instead of the literal "Invalid Date".
1813
+ return dt.isValid ? dt.toFormat(fmt) : '';
1808
1814
  }
1809
1815
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1810
1816
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisDatePipe, isStandalone: false, name: "tisDate" });
@@ -1820,18 +1826,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
1820
1826
  class TisDateTimePipe {
1821
1827
  transform(value, format) {
1822
1828
  const fmt = format || 'dd MMM yyyy hh:mm a';
1823
- if (typeof value == 'string' && value !== '') {
1824
- return DateTime.fromMillis(+value).toFormat(fmt);
1829
+ // Empty / "no date" inputs render blank (0 and "0" are treated as no-date).
1830
+ if (value === null || value === undefined || value === '' || value === 0 || value === '0') {
1831
+ return '';
1825
1832
  }
1826
- else if (typeof value == 'number') {
1827
- return DateTime.fromMillis(value).toFormat(fmt);
1833
+ let dt;
1834
+ if (value instanceof Date) {
1835
+ dt = DateTime.fromJSDate(value);
1828
1836
  }
1829
- else if (value === null || value === undefined) {
1830
- return '';
1837
+ else if (typeof value === 'number') {
1838
+ dt = DateTime.fromMillis(value);
1839
+ }
1840
+ else if (typeof value === 'string') {
1841
+ const num = Number(value);
1842
+ // Numeric string => epoch millis (unchanged); non-numeric => ISO date.
1843
+ dt = !isNaN(num) ? DateTime.fromMillis(num) : DateTime.fromISO(value);
1831
1844
  }
1832
1845
  else {
1833
- return 'Invalid Date';
1846
+ return '';
1834
1847
  }
1848
+ // Invalid inputs render blank instead of the literal "Invalid Date".
1849
+ return dt.isValid ? dt.toFormat(fmt) : '';
1835
1850
  }
1836
1851
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1837
1852
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimePipe, isStandalone: false, name: "tisDateTime" });
@@ -1847,18 +1862,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImpor
1847
1862
  class TisDateTimeWithSecondsPipe {
1848
1863
  transform(value, format) {
1849
1864
  const fmt = format || 'dd MMM yyyy hh:mm:ss a';
1850
- if (typeof value == 'string' && value !== '') {
1851
- return DateTime.fromMillis(+value).toFormat(fmt);
1865
+ // Empty / "no date" inputs render blank (0 and "0" are treated as no-date).
1866
+ if (value === null || value === undefined || value === '' || value === 0 || value === '0') {
1867
+ return '';
1852
1868
  }
1853
- else if (typeof value == 'number') {
1854
- return DateTime.fromMillis(value).toFormat(fmt);
1869
+ let dt;
1870
+ if (value instanceof Date) {
1871
+ dt = DateTime.fromJSDate(value);
1855
1872
  }
1856
- else if (value === null || value === undefined) {
1857
- return '';
1873
+ else if (typeof value === 'number') {
1874
+ dt = DateTime.fromMillis(value);
1875
+ }
1876
+ else if (typeof value === 'string') {
1877
+ const num = Number(value);
1878
+ // Numeric string => epoch millis (unchanged); non-numeric => ISO date.
1879
+ dt = !isNaN(num) ? DateTime.fromMillis(num) : DateTime.fromISO(value);
1858
1880
  }
1859
1881
  else {
1860
- return 'Invalid Date';
1882
+ return '';
1861
1883
  }
1884
+ // Invalid inputs render blank instead of the literal "Invalid Date".
1885
+ return dt.isValid ? dt.toFormat(fmt) : '';
1862
1886
  }
1863
1887
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimeWithSecondsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1864
1888
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.7", ngImport: i0, type: TisDateTimeWithSecondsPipe, isStandalone: false, name: "tisDateTimeWithSeconds" });