Skip to content

Ion-datetime selects disabeled day when changing month with month year picker #26904

Closed as not planned

Description

@eazyenno

https://ionicframework.com/docs/api/datetime

Ionic version:

[ ] 4.x
[ ] 5.x
[x] 6.6.0

I'm submitting a ...

[x] bug report
[ ] feature request

Current behavior:

It selects a date in the next or previous month even though they are disabled, when changing the month with the month-year picker.

Expected behavior:

It should just change the month without selecting any dates in the month.

Steps to reproduce:

I want to select multiple days in a ion-datetime to save the selection. When i select a Month like this
grafik

and then use this view at the top left and select for example february:
grafik

i get the message:

[Ionic Warning]: The value provided to ion-datetime is out of bounds.

Min: {"month":2,"day":15,"year":2023,"hour":23,"minute":0}
Max: {"month":4,"day":15,"year":2023,"hour":22,"minute":0}
Value: [{"year":2023,"month":3,"day":2,"tzOffset":0,"ampm":"pm"},{"year":2023,"month":2,"day":2,"tzOffset":0,"ampm":"pm"}]

and this happens:
grafik

it selects a day it shouldn't select due to the fact that its disabled.

Related code:

This is my html:
    <ion-datetime
      mode="ios"
      min="{{this.lastMonth.toISOString()}}"
      max="{{this.nextMonth.toISOString()}}"
      multiple="true"
      color="secondary"
      presentation="date"
      first-day-of-week="1"
      [highlightedDates]="highlightedDates"
    >
    </ion-datetime>

Last Month in this case is the 15. of the last month and next Month the 15. of the next Month

Other information:

Ionic info:

[Ionic Warning]: The value provided to ion-datetime is out of bounds.

Min: {"month":2,"day":15,"year":2023,"hour":23,"minute":0}
Max: {"month":4,"day":15,"year":2023,"hour":22,"minute":0}
Value: [{"year":2023,"month":3,"day":2,"tzOffset":0,"ampm":"pm"},{"year":2023,"month":2,"day":2,"tzOffset":0,"ampm":"pm"}]

Activity

  1. added
    ionitron: needs reproduction
    on Mar 3, 2023
  2. ionitron-bot commented on Mar 3, 2023

    @ionitron-bot

    Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

    Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

    If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

    For a guide on how to create a good reproduction, see our Contributing Guide.

  3. averyrousseau commented on Mar 17, 2023

    @averyrousseau
    Contributor

    This issue is being closed due to insufficient reproduction. If this is still a problem in the latest version of Ionic, please open a new issue and ensure the template is fully filled out. Thank you!

  4. locked and limited conversation to collaborators on Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ionitron: needs reproduction

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions