question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: date picker jumps to max date when navigating to next year

See original GitHub issue

Prerequisites

Ionic Framework Version

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

Current Behavior

When the max date property is used and the user moves from December 2022 to January 2023 the datepicker will switch to the given max date instead of moving to January

Expected Behavior

The datepicker should switch to January

Steps to Reproduce

  <ion-datetime
    locale="de-DE"
    presentation="date"
    [min]="'2022-08-03'"
    [max]="'2023-07-29'"
    showDefaultButtons="true"
    firstDayOfWeek="1"
  ></ion-datetime>

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.20.1 (/Users/danielsogl/.nvm/versions/node/v16.16.0/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 6.2.0 @angular-devkit/build-angular : 14.1.0 @angular-devkit/schematics : 14.1.0 @angular/cli : 14.1.0 @ionic/angular-toolkit : 6.1.0

Capacitor:

Capacitor CLI : 4.0.1 @capacitor/android : not installed @capacitor/core : 4.0.1 @capacitor/ios : not installed

Utility:

cordova-res : not installed globally native-run : 1.6.0

System:

NodeJS : v16.16.0 (/Users/danielsogl/.nvm/versions/node/v16.16.0/bin/node) npm : 8.15.1 OS : macOS

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
liamdebeasicommented, Aug 3, 2022

~Thanks for the issue. Can you provide a minimal GitHub repo for the issue?~

Never mind, I can reproduce the issue now. Let me take a closer look.

1reaction
liamdebeasicommented, Sep 1, 2022

This also impacts setting min and navigating to the previous year. (https://github.com/ionic-team/ionic-framework/issues/25870)

Read more comments on GitHub >

github_iconTop Results From Across the Web

JQuery Datepicker without year issue with minDate and ...
So I set the min and max dates to 2012 (the last leap year) so that they can choose Feb 29th.
Read more >
{10} open ui.{plugin} tickets -- ?P=plugin (102 matches)
Ticket Summary Type Status Priority Created #6228 Datepicker: Use widget factory bug open blocker Oct 26, 2010 Ticket Summary Type Status Priority Created #14942 Datepicker tests...
Read more >
DatePicker | Apple Developer Documentation
You can limit the DatePicker to specific ranges of dates, allowing selections only before or after a certain date, or between two dates....
Read more >
Date picker – Carbon Design System
Selecting a year. By default the current date and year appears in the calendar. To navigate to another year the user can do...
Read more >
Date range picker | U.S. Web Design System (USWDS)
The date picker input will set this value if it is a valid date. The date should be in the format YYYY-MM-DD ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found