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: Cannot change AM/PM input in ion-datetime

See original GitHub issue

Bug Report

Ionic version: [x] 4.x

Current behavior: Cannot change AM/PM input in ion-datetime element.

Expected behavior: Should be able to change AM/PM input in ion-datetime element.

Steps to reproduce:

  1. cd into cloned github project directory
  2. run ng serve
  3. open website in browser
  4. click rendered ion-datetime element
  5. try to change am/pm input
  6. see “Error parsing date: “[object Object]”. Please provide a valid ISO 8601 datetime format: https://www.w3.org/TR/NOTE-datetime” in console

Related code:

https://github.com/godspeed529/datetime-error-parsing-date

Other information: This regression was introduced in v4.5.0

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.5.0
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

System:

   NodeJS : v10.14.1 (/usr/local/bin/node)
   npm    : 6.9.0
   OS     : macOS Mojave

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:35 (19 by maintainers)

github_iconTop GitHub Comments

6reactions
liamdebeasicommented, Jul 11, 2019

Hi everyone,

I have created a dev build with the AM/PM datetime fix. If people could test with their apps and let me know if the issue is resolved for them, that would be great! (This is based off the latest master, which has the 4.6.2 changes)

Using Angular:

npm i @ionic/angular@4.7.0-dev.201907111702.67c0d82

Using Ionic Core:

npm i @ionic/core@4.7.0-dev.201907111702.67c0d82

Thanks!

4reactions
liamdebeasicommented, Jun 28, 2019

We fixed a bug that landed in 4.5.0 where changing the selected hour/minute/second etc did not refresh the picker values according to the max and min constraints.

That functionality should have been in there from the start, but there was a bug that prevented it from working. Had that bug not been in there, this current bug would have appeared. The AM/PM switching appeared to work only because another part of the datetime functionality was broken.

In reality, switching AM/PM should update which date/time values are displaying in ion-datetime since it is possible a user sets the max value to be something like June 28, 2019 5:30pm. With June 27, 2019 selected, the user should be able to select past 5:30pm but not if June 28, 2019 is selected.

Hope this clears things up. I am currently investigating a fix, and I hope to have it land soon. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: Cannot change AM/PM input in ion-datetime · Issue #18585
Steps to reproduce: cd into cloned github project directory; run ng serve; open website in browser; click rendered ion-datetime element; try to ...
Read more >
Ionic time select fails to display AM / PM for Android
Works for iOS, but fails in Android with replacing AM / PM with .. Here's the code that works for iOS <ion-datetime #datePicker...
Read more >
Translate the time period (AM, PM) in ion-datetime - Ionic Forum
Hey everyone,. Is it possible to translate the time period (AM, PM) from ion-datetime? I have successfully translated the other text ...
Read more >
Date picker popup in Ionic 6 | Damir's Corner
Ionic 6 introduced a breaking change to the date picker. Instead of being a popup like in Ionic 6, it is now rendered...
Read more >
Responsive date & time picker documentation for Ionic
Using inline opions to customize the datetime components ... <ion-item> <ion-label>My Birthday</ion-label> <ion-input [(ngModel)]="birthday" mbsc-date ...
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