Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: datepicker touched/dirty bugs (#968)
* fix datepicker touched/dirty bugs * demonstrate form use with range of dates * remove extra margin * fix conflict
- Loading branch information
1 parent
287b43e
commit bf69937
Showing
9 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...mentation/component-docs/date-picker/examples/date-picker-form-range-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component } from '@angular/core'; | ||
import { FormGroup, FormControl } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'fd-date-picker-form-range-example', | ||
template: ` | ||
<form [formGroup]="customForm"> | ||
<fd-date-picker type="range" formControlName="dates"></fd-date-picker> | ||
</form> | ||
Touched: {{customForm.controls.dates.touched}}<br/> | ||
Dirty: {{customForm.controls.dates.dirty}}<br/> | ||
Range Start Date: {{ customForm.controls.dates.value.date ? customForm.controls.dates.value.date.toDateString() : 'null' }}<br/> | ||
Range End Date: {{ customForm.controls.dates.value.rangeEnd ? customForm.controls.dates.value.rangeEnd.toDateString() : 'null' }} | ||
` | ||
}) | ||
export class DatePickerFormRangeExampleComponent { | ||
|
||
today: Date = new Date(); | ||
|
||
customForm = new FormGroup({ | ||
dates: new FormControl({ date: this.today, rangeEnd: new Date(this.today.getTime() + 432000000) }) | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters