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: Minimum date in Datetime causes issues with 12-hour clock

See original GitHub issue

Prerequisites

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: image

PM picker result: image

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:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Sep 16, 2022

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:

npm install @ionic/angular@6.2.8-dev.11663343248.1fce52ab

Note: You may need to test this in a local Ionic app. StackBlitz sometimes has trouble installing dev builds.

0reactions
ionitron-bot[bot]commented, Oct 19, 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

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 >

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