mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
fix(datetime): account for 0 value when setting up picker columns (#17869)
This commit is contained in:
@ -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);
|
||||
|
@ -99,6 +99,11 @@
|
||||
<ion-datetime display-format="HH:mm"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>HH:mm (initial value 00:00)</ion-label>
|
||||
<ion-datetime display-format="HH:mm" value="00:00"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>h:mm a</ion-label>
|
||||
<ion-datetime display-format="h:mm a" value="01:47"></ion-datetime>
|
||||
|
Reference in New Issue
Block a user