-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(datetime): set disabled state from FormControl
- Loading branch information
1 parent
b44ff41
commit 99c493e
Showing
3 changed files
with
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Component, NgModule } from '@angular/core'; | ||
import { FormControl, FormGroup } from '@angular/forms'; | ||
import { IonicApp, IonicModule } from '../../../..'; | ||
|
||
|
||
|
||
@Component({ | ||
templateUrl: 'main.html' | ||
}) | ||
export class E2EPage { | ||
stackedCtrl = new FormControl('1994-12-15T13:47:20.789'); | ||
floatingCtrl = new FormControl('1995-04-15'); | ||
fixedCtrl = new FormControl({value: '2002-09-23T15:03:46.789', disabled: true}); | ||
inlineCtrl = new FormControl({value: '2005-06-17T11:06Z', disabled: true}); | ||
|
||
datetimeForm = new FormGroup({ | ||
'stacked': this.stackedCtrl, | ||
'floating': this.floatingCtrl, | ||
'fixed': this.fixedCtrl, | ||
'inline': this.inlineCtrl | ||
}); | ||
|
||
} | ||
|
||
|
||
@Component({ | ||
template: '<ion-nav [root]="root"></ion-nav>' | ||
}) | ||
export class E2EApp { | ||
root = E2EPage; | ||
} | ||
|
||
@NgModule({ | ||
declarations: [ | ||
E2EApp, | ||
E2EPage | ||
], | ||
imports: [ | ||
IonicModule.forRoot(E2EApp) | ||
], | ||
bootstrap: [IonicApp], | ||
entryComponents: [ | ||
E2EPage | ||
] | ||
}) | ||
export class AppModule {} |
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,32 @@ | ||
<ion-header> | ||
|
||
<ion-toolbar> | ||
<ion-title>Datetime</ion-title> | ||
</ion-toolbar> | ||
|
||
</ion-header> | ||
|
||
|
||
<ion-content class="outer-content"> | ||
<form [formGroup]="datetimeForm"> | ||
<ion-item> | ||
<ion-label stacked>Stacked</ion-label> | ||
<ion-datetime formControlName="stacked"></ion-datetime> | ||
</ion-item> | ||
|
||
<ion-item> | ||
<ion-label floating>Floating</ion-label> | ||
<ion-datetime formControlName="floating" displayFormat="MMMM YY"></ion-datetime> | ||
</ion-item> | ||
|
||
<ion-item> | ||
<ion-label fixed>Fixed</ion-label> | ||
<ion-datetime formControlName="fixed" displayFormat="MM/DD/YYYY"></ion-datetime> | ||
</ion-item> | ||
|
||
<ion-item> | ||
<ion-label>Inline</ion-label> | ||
<ion-datetime formControlName="inline" displayFormat="MM/DD/YYYY"></ion-datetime> | ||
</ion-item> | ||
</form> | ||
</ion-content> |