From 34f6f1d736bc9844c97d1342461a870f97dd7c1e Mon Sep 17 00:00:00 2001 From: pwespi Date: Mon, 25 Mar 2019 13:49:29 +0100 Subject: [PATCH] fix(datetime): account for 0 value when setting up picker columns (#17869) --- core/src/components/datetime/datetime-util.ts | 2 +- core/src/components/datetime/test/basic/index.html | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/components/datetime/datetime-util.ts b/core/src/components/datetime/datetime-util.ts index 6a18709ca0..865d6af6c2 100644 --- a/core/src/components/datetime/datetime-util.ts +++ b/core/src/components/datetime/datetime-util.ts @@ -6,7 +6,7 @@ export function getDateValue(date: DatetimeData, format: string): number { const getValue = getValueFromFormat(date, format); - if (getValue) { return getValue; } + if (getValue !== undefined) { return getValue; } const defaultDate = parseDate(new Date().toISOString()); return getValueFromFormat((defaultDate as DatetimeData), format); diff --git a/core/src/components/datetime/test/basic/index.html b/core/src/components/datetime/test/basic/index.html index cbbaa87efc..2dce84bfd7 100644 --- a/core/src/components/datetime/test/basic/index.html +++ b/core/src/components/datetime/test/basic/index.html @@ -99,6 +99,11 @@ + + HH:mm (initial value 00:00) + + + h:mm a