diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx
index 389d7a88bc..1cf77789f7 100644
--- a/core/src/components/datetime/datetime.tsx
+++ b/core/src/components/datetime/datetime.tsx
@@ -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() {
diff --git a/core/src/components/datetime/test/basic/index.html b/core/src/components/datetime/test/basic/index.html
index 01b9f4b069..3cf5be322a 100644
--- a/core/src/components/datetime/test/basic/index.html
+++ b/core/src/components/datetime/test/basic/index.html
@@ -31,6 +31,16 @@
Default
+
+
+ Default with floating label
+
+
+
+
+ Placeholder with floating label
+
+
Max