Skip to content

Commit

Permalink
#4434 Fixed Filter row date pipe error in IE11. (#4443)
Browse files Browse the repository at this point in the history
* fix(Filter): #4434 Fixed Date pipe error in IE11.

* fix(Filter): #4434 Fixed Date pipe error in IE11.

* fix(Filter): #4434 Fixed Date pipe error in IE11.

* fix(Filter): #4434 Fix date pipe error simpler.
  • Loading branch information
gedinakova authored Apr 11, 2019
1 parent 0b2768e commit f0a0bf5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ describe('IgxDatePicker', () => {
it('Initialize a datepicker component', () => {
expect(fixture.componentInstance).toBeDefined();
expect(datePicker.displayData).toBe('');
expect(datePicker.displayDataISO).toBe('');
});

it('Initialize a datepicker component with id', () => {
Expand Down Expand Up @@ -246,7 +245,6 @@ describe('IgxDatePicker', () => {
const dateConvertedToDeLocale = fixture.componentInstance.date.toLocaleDateString('de-DE');

expect(datePicker.displayData).toBe(dateConvertedToDeLocale);
expect(datePicker.displayDataISO).toBe(fixture.componentInstance.date.toISOString());
});

it('Datepicker custom formatter', () => {
Expand All @@ -261,7 +259,6 @@ describe('IgxDatePicker', () => {
const formattedDate = compInstance.customFormatter(date);

expect(inputTarget.value).toEqual(formattedDate);
expect(datePicker.displayDataISO).toBe(date.toISOString());
});

it('Value should respond when is bound through ngModel and selection through selectDate method is made.', fakeAsync(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,6 @@ export class IgxDatePickerComponent implements ControlValueAccessor, EditorProvi
}
return '';
}
/**
*@hidden
* Convert the value to an ISO string to ensure the date pipe can handle it in IE11.
* Used in the template for record filtering.
* Issue #4434.
*/
public get displayDataISO() {
return (this.value) ? this.value.toISOString() : '';
}

/**
*@hidden
Expand Down Expand Up @@ -657,8 +648,7 @@ export class IgxDatePickerComponent implements ControlValueAccessor, EditorProvi
return {
value: this.value,
displayData: this.displayData,
openDialog: () => { this.openDialog(); },
displayDataISO: this.displayDataISO
openDialog: () => { this.openDialog(); }
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<ng-template #defaultDateUI>
<igx-date-picker tabindex="0" [(ngModel)]="value" [locale]="filteringService.grid.locale" (onClose)="datePickerClose()">
<ng-template igxDatePickerTemplate let-openDialog="openDialog" let-displayData="displayDataISO">
<ng-template igxDatePickerTemplate let-openDialog="openDialog">
<igx-input-group type="box" [displayDensity]="'compact'" [supressInputAutofocus]="true">
<igx-prefix #inputGroupPrefix
tabindex="0"
Expand All @@ -56,7 +56,7 @@
(click)="openDatePicker(openDialog)"
[placeholder]="placeholder"
autocomplete="off"
[value]="displayData | date"
[value]="value | igxdate: filteringService.grid.locale"
[readonly]="true"
(keydown)="onInputKeyDown($event)"/>
<igx-suffix *ngIf="value" (keydown)="onClearKeyDown($event)" (click)="clearInput()" tabindex="0">
Expand Down

0 comments on commit f0a0bf5

Please sign in to comment.