fix(datetime): datetime no longer reports having a value if none is set (#18541)

fixes #17979 
fixes #18540
This commit is contained in:
Kelvin Dart
2019-06-27 15:48:09 +01:00
committed by Manu Mtz.-Almeida
parent 0d58101edc
commit 92e0f98633
2 changed files with 11 additions and 2 deletions

View File

@@ -565,8 +565,7 @@ export class Datetime implements ComponentInterface {
}
private hasValue(): boolean {
const val = this.datetimeValue;
return Object.keys(val).length > 0;
return this.text !== undefined;
}
private setFocus() {

View File

@@ -31,6 +31,16 @@
<ion-label>Default</ion-label>
<ion-datetime></ion-datetime>
</ion-item>
<ion-item>
<ion-label position="floating">Default with floating label</ion-label>
<ion-datetime></ion-datetime>
</ion-item>
<ion-item>
<ion-label position="floating">Placeholder with floating label</ion-label>
<ion-datetime placeholder="Select a date"></ion-datetime>
</ion-item>
<ion-item>
<ion-label>Max</ion-label>