bug: Minimum date in Datetime causes issues with 12-hour clock
See original GitHub issuePrerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
- Nightly
Current Behavior
Setting a minimum datetime causes noon (12pm) to be missing from the PM time picker. Instead it shows in the AM picker.
Note: I tried using the hourCycle
property but that didn’t change anything.
Current values:
minuteValues: string = '0,15,30,45';
min: string = '2022-04-25T08:30:00';
max: string = '2022-04-25T21:30:00';
AM picker result:
PM picker result:
Expected Behavior
The time picker should correctly display the following options: AM picker: 8:30 - 11:45 PM picker: 12:00 - 21:30
Steps to Reproduce
Tested both on @ionic/angular
versions 6.1.0
and 6.1.3-dev.11650654723.120c74ee
.
Open the StackBlitz URL below and try to select 12pm.
Code Reproduction URL
https://stackblitz.com/edit/ionic6-angular13-bptrsx?file=src%2Fapp%2Fapp.component.html
Ionic Info
On my machine:
Ionic:
Ionic CLI : 6.16.3 (...npm\node_modules\@ionic\cli)
Ionic Framework : @ionic/angular 6.1.3-dev.11650654723.120c74ee
@angular-devkit/build-angular : 13.3.3
@angular-devkit/schematics : 13.3.3
@angular/cli : 13.3.3
@ionic/angular-toolkit : 6.1.0
...
System:
NodeJS : v14.16.1 (C:\Program Files\nodejs\node.exe)
npm : 6.14.12
OS : Windows 10
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Solved: 24 hour to 12 hour date picker issue
24 hour to 12 hour date picker issue · 1. Change the MiniutesValue to AMPMValue, set Items and Default property the same with...
Read more >Time formatting and storage bugs - Wikipedia
In computer science, time formatting and storage bugs are a class of software bugs that may cause time and date calculation or display...
Read more >day,month cut working but hour cut causing Error in cut.default ...
Try this, it is a special format for converting dates to characters and occurs after the cut, so it does not conflict with...
Read more >Demystifying DateTime Manipulation in JavaScript - Toptal
Time and date manipulation is notoriously difficult. Developers encountering time zone rules, leap seconds, differences in locale-specific formatting are ...
Read more >Datetime functions | BigQuery - Google Cloud
Constructs a DATETIME object using a DATE object and an optional TIME object. ... SELECT EXTRACT(HOUR FROM DATETIME(2008, 12, 25, 15, 30, 00))...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi there,
Here is a dev build with a proposed fix if anyone is interested in testing:
6.2.8-dev.11663343248.1fce52ab
Install Example:
Note: You may need to test this in a local Ionic app. StackBlitz sometimes has trouble installing dev builds.
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.