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: The year / month selected in the year / month picker will be reflected in the calendar with a one-month shift.

See original GitHub issue

Prerequisites

Ionic Framework Version

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

Current Behavior

Safari on iPhone iOS 15.1

  • In Safari on iOS, after the ion-datetime embedded in ion-popover is displayed, the year / month selected in the year / month picker will be reflected in the calendar with a one-month shift.

https://user-images.githubusercontent.com/87968771/146101658-5c7cff37-9617-4e5d-b32e-ccb31797beb1.mp4

Google Chrome on Android 12 or Windows10

  • However, it will be reflected correctly on Google Chrome on Android or Windows.

https://user-images.githubusercontent.com/87968771/146101870-ee8c0f4d-673e-485f-b51c-56f27592abf3.mp4

Expected Behavior

  • I want you to improve the behavior of Safari on iOS.

Steps to Reproduce

  1. Run the code below to build.
    <ion-label>{{ report_date | date:"yyyy年MM月dd日 (EEE)" }}</ion-label>
    <ion-popover [isOpen]="isPopover" arrow="false" style="--offset-y: -35%;">
      <ng-template>
        <ion-datetime (ionChange)="onChangeDate($event)" showDefaultTitle="true" presentation="date">
          <div slot="title">報告日</div>
        </ion-datetime>
      </ng-template>
    </ion-popover>
    
  2. I did the same operation as the video I uploaded to Current Behavior.

Code Reproduction URL

Ionic Info

Ionic:

   Ionic CLI                     : 6.18.1 (C:\Users\Administrator\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 6.0.1
   @angular-devkit/build-angular : 13.0.4
   @angular-devkit/schematics    : 13.0.4
   @angular/cli                  : 13.0.4
   @ionic/angular-toolkit        : 5.0.3

Capacitor:

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

Utility:

   cordova-res : 0.15.4
   native-run  : 1.5.0

System:

   NodeJS : v14.17.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.13
   OS     : Windows 10

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
liamdebeasicommented, Jan 12, 2022

Glad to hear the fix is working for you! This has been resolved via https://github.com/ionic-team/ionic-framework/pull/24554, and a fix will be available in an upcoming release of Ionic Framework.

0reactions
ionitron-bot[bot]commented, Feb 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error changing the year in the date picker - Anvil Works
Click on a date picker, change the year and click on apply. The year on the widget does not change.
Read more >
Datepicker Month and Year Selected error - Stack Overflow
Then i change the datepicker options for user choose only Month and Year, and its work well. For example, if i select "JAN/2017",...
Read more >
<input type="month"> - HTML: HyperText Markup Language
Clicking the down arrow on the right-hand side brings up a date picker that lets you select the month and year. Month control...
Read more >
Dates and times - Looker Studio Help - Google Support
You can use Looker Studio to visualize and compare dates and times in ... For example, adding a Date field to your chart...
Read more >
ion-datetime - Ionic Framework
Setting time-date will have the calendar picker appear after the time picker. Month and Year Selection​. Month and year selection is available by...
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