Skip to content

bug: ion-datetime overlay switching to different month when a date is selected #31143

@danielshewa

Description

@danielshewa

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

When a date is selected for ion-datetime with an overlay, it initially displays the correct year and month, but no date is selected. After selecting a date, the component unexpectedly switches to a different month, selects a random day, and does not close the ion-datetime overlay.

Expected Behavior

When a date is selected, the ion-datetime picker overlay should display the correct year, month, and selected date. When a different date is chosen, the textbox should update to reflect the correct year, month, and date, and the ion-datetime overlay should close.

Steps to Reproduce

  1. Go to https://ionicframework.com/docs/api/datetime-button#basic-usage
  2. Click the datetime button to open the picker overlay.
  3. Select any date.

Actual Result:
The picker toggles to a different month instead of correctly selecting the date.

Code Reproduction URL

https://stackblitz.com/edit/62rrssqj

Ionic Info

Locally tested this on
@ionic/angular v8.8.6

For IOS
@capacitor/ios v"8.1.0"

Additional Information

Attached is an example from the ionic website

ion-datetime-bug.mp4

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