diff --git a/src/components/datetime/datetime.ts b/src/components/datetime/datetime.ts index b73799542b..4cdb8dee73 100644 --- a/src/components/datetime/datetime.ts +++ b/src/components/datetime/datetime.ts @@ -860,6 +860,13 @@ export class DateTime extends Ion implements AfterContentInit, ControlValueAcces */ onTouched() { } + /** + * @private + */ + setDisabledState(isDisabled: boolean) { + this.disabled = isDisabled; + } + /** * @private */ diff --git a/src/components/datetime/test/form/app-module.ts b/src/components/datetime/test/form/app-module.ts new file mode 100644 index 0000000000..a5a39c92e6 --- /dev/null +++ b/src/components/datetime/test/form/app-module.ts @@ -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: '' +}) +export class E2EApp { + root = E2EPage; +} + +@NgModule({ + declarations: [ + E2EApp, + E2EPage + ], + imports: [ + IonicModule.forRoot(E2EApp) + ], + bootstrap: [IonicApp], + entryComponents: [ + E2EPage + ] +}) +export class AppModule {} diff --git a/src/components/datetime/test/form/main.html b/src/components/datetime/test/form/main.html new file mode 100644 index 0000000000..76450ae968 --- /dev/null +++ b/src/components/datetime/test/form/main.html @@ -0,0 +1,32 @@ + + + + Datetime + + + + + + +
+ + Stacked + + + + + Floating + + + + + Fixed + + + + + Inline + + +
+