Skip to content

Commit 056439e

Browse files
committed
fix: TT-167 Date picker disable future dates
1 parent 36a3b9b commit 056439e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/app/modules/shared/components/details-fields/details-fields.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
[class.is-invalid]="start_date.invalid && start_date.touched"
9292
required
9393
(ngModelChange)="onStartDateChange($event)"
94-
[max]="getActualDate()"
94+
[max]="getCurrentDate()"
9595
onkeydown="return false"
9696
/>
9797
</div>
@@ -120,7 +120,7 @@
120120
aria-describedby="inputGroup-sizing-sm"
121121
[class.is-invalid]="end_date.invalid && end_date.touched"
122122
required
123-
[max]="getActualDate()"
123+
[max]="getCurrentDate()"
124124
onkeydown="return false"
125125
/>
126126
</div>

src/app/modules/shared/components/details-fields/details-fields.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ describe('DetailsFieldsComponent', () => {
472472
it('on get actual date should return the current date', () => {
473473
const actualDateExpected = new Date().toISOString().split('T')[0];
474474

475-
expect(component.getActualDate()).toEqual(actualDateExpected);
475+
expect(component.getCurrentDate()).toEqual(actualDateExpected);
476476
});
477477
/*
478478
TODO As part of https://github.com/ioet/time-tracker-ui/issues/424 a new parameter was added to the details-field-component,

src/app/modules/shared/components/details-fields/details-fields.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
171171
this.selectedTechnologies = $event;
172172
}
173173

174-
getActualDate(): string {
174+
getCurrentDate(): string {
175175
return new Date().toISOString().split('T')[0];
176176
}
177177

0 commit comments

Comments
 (0)