Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: initial value in ion-datetime with "time" presentation not shown #24878

Closed
4 of 6 tasks
sburnicki opened this issue Mar 4, 2022 · 7 comments · Fixed by #24879
Closed
4 of 6 tasks

bug: initial value in ion-datetime with "time" presentation not shown #24878

sburnicki opened this issue Mar 4, 2022 · 7 comments · Fixed by #24879
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@sburnicki
Copy link

Prerequisites

Ionic Framework Version

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

Current Behavior

ion-datetime with presentation="time" and an initial value shows the wrong value ("12:00 AM") until you interact with the component (click in the video).
https://user-images.githubusercontent.com/5701519/156773032-af44b34f-cf27-48e3-8bc5-86c513303cd5.mp4

Expected Behavior

The datetime component with presentation="time" should initially show the time passed via "value" attribute.

Steps to Reproduce

  • add a datetime component <ion-datetime presentation="time" [value]="'16:23'"></ion-datetime>
  • go to the page with the component
  • the component shows "12:00 AM" instead of "4:23 PM"

Code Reproduction URL

https://github.com/sburnicki/ionic-bug-datetime-time-initial-value

Ionic Info

Ionic:

   Ionic CLI                     : 6.18.1 
   Ionic Framework               : @ionic/angular 6.0.10
   @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.4.2
   @capacitor/android : not installed
   @capacitor/core    : 3.4.2
   @capacitor/ios     : not installed

Utility:

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

System:

   NodeJS : v16.13.1 
   npm    : 8.1.2
   OS     : Linux 5.11

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Mar 4, 2022
@liamdebeasi liamdebeasi self-assigned this Mar 4, 2022
@liamdebeasi
Copy link
Contributor

liamdebeasi commented Mar 4, 2022

Thanks for the issue. I can reproduce this behavior. This behavior changed in aacb58a according to git bisect. cc @sean-perkins

I verified this in src/components/datetime/test/minmax test file.


We do have screenshot tests for this file that should have caught this: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/datetime/test/minmax/e2e.ts. The screenshots are not full size, so this particular reproduction in the minmax test was probably out of viewport.

@liamdebeasi
Copy link
Contributor

Thanks for the issue. Can you try the following dev build and let me know if it resolves the issue?

6.0.11-dev.11646403908.14a66af

This dev build applies to any of our packages (Angular, React, Vue, Core).

@sburnicki
Copy link
Author

Thanks for the insanely fast response and fix.
I can confirm that the issues is resolved in 6.0.11-dev.11646403908.14a66af

@liamdebeasi
Copy link
Contributor

Glad to hear the issue is resolved. Feel free to continue using that build for development until this fix ships.

@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #24879, and a fix will be available in an upcoming release of Ionic Framework.

@liamdebeasi
Copy link
Contributor

A fix has been released as part of Ionic 6.0.11.

@ionitron-bot
Copy link

ionitron-bot bot commented Apr 8, 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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants