Skip to content

bug: ion-datetime is broken/fails when the current value is not defined, the min value is in the future and time format is 12-hour #25296

@ryaa

Description

@ryaa

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

Datetime control show empty time popover and when it is dismissed an error occurs which makes ion-datetime unusable.
Note that the value provided to the control is null and the min property must be in the future. If the min property is in the past then everything works fine.

Expected Behavior

Time part needs to be displayed correctly and no error when it is dismissed/closed

Steps to Reproduce

  1. open this link https://ionic6-angular13-qkrphu.stackblitz.io/
  2. tap on the button
  3. tap on the time control
    Note that the popover opened is empty - see below
    Screen Shot 2022-05-17 at 07 41 21
  4. tap outside of the popover to dismiss it
    Note that an error is triggered/thrown - see below
    Screen Shot 2022-05-17 at 07 41 38

You can also see the problem here https://stackblitz.com/edit/ionic6-angular13-qkrphu?file=src%2Fapp%2Fapp.component.ts

Code Reproduction URL

https://stackblitz.com/edit/ionic6-angular13-qkrphu?file=src%2Fapp%2Fapp.component.ts

Ionic Info

See https://stackblitz.com/edit/ionic6-angular13-qkrphu?file=src%2Fapp%2Fapp.component.ts

Additional Information

This seems to be related to #22756 which has been reported to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions