Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix datetimepicker form bugs, add form example (#978)
- Loading branch information
1 parent
31addcd
commit 966723f
Showing
6 changed files
with
38 additions
and
0 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
8 changes: 8 additions & 0 deletions
8
...-docs/datetime-picker/examples/datetime-form-example/datetime-form-example.component.html
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,8 @@ | ||
<form [formGroup]="customForm"> | ||
<fd-datetime-picker formControlName="date"></fd-datetime-picker> | ||
</form> | ||
|
||
Touched: {{customForm.controls.date.touched}}<br/> | ||
Dirty: {{customForm.controls.date.dirty}}<br/> | ||
|
||
Selected Date: {{ customForm.controls.date.value ? customForm.controls.date.value.toDateString() : 'null' }} |
12 changes: 12 additions & 0 deletions
12
...nt-docs/datetime-picker/examples/datetime-form-example/datetime-form-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,12 @@ | ||
import { Component } from '@angular/core'; | ||
import { FormControl, FormGroup } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'fd-datetime-form-example', | ||
templateUrl: './datetime-form-example.component.html' | ||
}) | ||
export class DatetimeFormExampleComponent { | ||
customForm = new FormGroup({ | ||
date: new FormControl(new Date()) | ||
}); | ||
} |
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