Skip to content

Commit dec4f80

Browse files
committed
fix(datetime): display today's date and time when value is an empty string
fixes #29669
1 parent b6b92ec commit dec4f80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/components/datetime/datetime.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,8 @@ export class Datetime implements ComponentInterface {
12341234
}
12351235

12361236
private processValue = (value?: string | string[] | null) => {
1237-
const hasValue = value !== null && value !== undefined && (!Array.isArray(value) || value.length > 0);
1237+
const hasValue =
1238+
value !== null && value !== undefined && value != '' && (!Array.isArray(value) || value.length > 0);
12381239
const valueToProcess = hasValue ? parseDate(value) : this.defaultParts;
12391240

12401241
const { minParts, maxParts, workingParts, el } = this;

0 commit comments

Comments
 (0)