Skip to content

bug: ion-datetime not accepting initial values across months when using with multiple option #29094

Open
@kumararun05

Description

@kumararun05

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

ion-datetime component in Angular doesn't accept values across different months when using with multiple="true". It works very well when we specify any values from the same month but if we supply value property across different months then it renders the calendar of 2021. It works in case of React but breaking in Angular. User is able to select the values from the calendar from multiple months but when the saved value or initial value that contains date across months, then it breaks.

Expected Behavior

ion-datetime component should accept values across different months when using with multiple="true" with Angular.

Steps to Reproduce

This is for Angular example.

  1. Open the example Stackblitz url of the ion-datetime.
  2. In the example.component.ts define a property named as selectedDates and assign the values as selectedDates = ['2024-02-20', '2024-03-05'] . Ensure that one date is from February and the other is from March.
  3. In the example.component.html file, pass the selectedDates property to the value attribute.
  4. Note that the calendar is not displaying the selected dates correctly, and it renders the calendar from the year 2021.

Code Reproduction URL

https://stackblitz.com/edit/angular-qtxwpy?file=src%2Fapp%2Fexample.component.ts

Ionic Info

@angular/animations 17.0.1

@angular/common 17.0.1

@angular/compiler 17.0.1

@angular/core 17.0.1

@angular/forms 17.0.1

@angular/platform-browser 17.0.1

@angular/platform-browser-dynamic 17.1.1

@angular/router 17.0.1

@ionic/angular 7.7.3

@ionic/core 7.7.3

rxjs 7.8.1

tslib 2.6.2

zone.js 0.14.2

Additional Information

No response

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