diff --git a/lib/core/src/lib/card-view/components/card-view-arrayitem/card-view-arrayitem.component.html b/lib/core/src/lib/card-view/components/card-view-arrayitem/card-view-arrayitem.component.html index 39b2eb0376..d79d5d59fa 100644 --- a/lib/core/src/lib/card-view/components/card-view-arrayitem/card-view-arrayitem.component.html +++ b/lib/core/src/lib/card-view/components/card-view-arrayitem/card-view-arrayitem.component.html @@ -2,19 +2,19 @@
- + {{item.icon}} {{item?.value}} - {{items.length - displayCount()}} {{'CORE.CARDVIEW.MORE' | translate}} + {{items.length - displayCount}} {{'CORE.CARDVIEW.MORE' | translate}} @@ -32,7 +32,7 @@ {{item.icon}} {{item?.value}} @@ -45,7 +45,7 @@ {{ property?.default | translate }} -
- - {{ property.displayValue }} + {{ property.displayValue }}
- {{ property.displayValue }} + {{ property.displayValue }} diff --git a/lib/core/src/lib/card-view/components/card-view-mapitem/card-view-mapitem.component.ts b/lib/core/src/lib/card-view/components/card-view-mapitem/card-view-mapitem.component.ts index 3f2d14dfab..7ff8e418f5 100644 --- a/lib/core/src/lib/card-view/components/card-view-mapitem/card-view-mapitem.component.ts +++ b/lib/core/src/lib/card-view/components/card-view-mapitem/card-view-mapitem.component.ts @@ -29,11 +29,11 @@ export class CardViewMapItemComponent extends BaseCardView @Input() displayEmpty: boolean = true; - showProperty() { + get showProperty(): boolean { return this.displayEmpty || !this.property.isEmpty(); } - isClickable() { + get isClickable(): boolean { return this.property.clickable; } diff --git a/lib/core/src/lib/common/utils/date-fns-utils.spec.ts b/lib/core/src/lib/common/utils/date-fns-utils.spec.ts index bdc7e41ed1..0c3e1a9982 100644 --- a/lib/core/src/lib/common/utils/date-fns-utils.spec.ts +++ b/lib/core/src/lib/common/utils/date-fns-utils.spec.ts @@ -125,4 +125,11 @@ describe('DateFnsUtils', () => { const result = DateFnsUtils.isValidDate('2021-06-09 14:10', 'D-M-YYYY hh:mm A'); expect(result).toBeFalse(); }); + + it('should return Date when forcing locale or UTC with string date argument', () => { + const resultLocal = DateFnsUtils.forceLocal('2014-02-11T11:30:30'); + const resultUtc = DateFnsUtils.forceUtc('2014-02-11T11:30:30'); + expect(resultLocal).toBeInstanceOf(Date); + expect(resultUtc).toBeInstanceOf(Date); + }); }); diff --git a/lib/core/src/lib/common/utils/date-fns-utils.ts b/lib/core/src/lib/common/utils/date-fns-utils.ts index a2ad06e486..4f317583be 100644 --- a/lib/core/src/lib/common/utils/date-fns-utils.ts +++ b/lib/core/src/lib/common/utils/date-fns-utils.ts @@ -203,11 +203,17 @@ export class DateFnsUtils { return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); } - static forceLocal(date: Date): Date { + static forceLocal(date: string | Date): Date { + if (typeof date === 'string'){ + date = parseISO(date); + } return new Date(lightFormat(date, 'yyyy-MM-dd')); } - static forceUtc(date: Date): Date { + static forceUtc(date: string | Date): Date { + if (typeof date === 'string'){ + date = parseISO(date); + } return new Date(lightFormat(date, 'yyyy-MM-dd').concat('T00:00:00.000Z')); }