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: HH:mm does not let you select hours #22199

Closed
dibyendusaha opened this issue Sep 28, 2020 · 2 comments · Fixed by #22207
Closed

bug: HH:mm does not let you select hours #22199

dibyendusaha opened this issue Sep 28, 2020 · 2 comments · Fixed by #22207
Labels
package: core @ionic/core package type: bug a confirmed bug report
Milestone

Comments

@dibyendusaha
Copy link

Bug Report

Ionic version:
[x] 5.3.4

Current behavior:
Using Ionic with Angular. issue with ion-datetime picker. When providing max & min (in HH:mm) for ion-datetime picker, it is behaving abruptly and that's too in between 13:00 & 00:30 (so far I have encountered that only), like you want to select 18:00 you get selection as 06:00, occurring mainly while selecting hours column and you need to select anything between 13:00 to 23:00, if you are selecting anything other than that, it will work fine

Expected behavior:
Expected behavior is, the time I want to select should be the one only and there should not be any abrupt behavior.

Steps to reproduce:
Create new ionic angular project with version 5.3.4

ionic start ionDateTimeBug blank --capacitor

Run the app

ionic serve

Related code:

Angular Page/View

<ion-content>

   <ion-item>
    <ion-label>Time</ion-label>
    <ion-datetime [hourValues]="hourValues " displayFormat="hh:mm A" pickerFormat="HH:mm" [min]="minTime" [max]="maxTime"></ion-datetime>
  </ion-item>  

</ion-content>

Associated Angular Component

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html',
  styleUrls: ['app.component.scss'],
})
export class AppComponent {
  minTime = '06:30';
  maxTime = '23:30';
  hourValues = ['06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23'];
  constructor() {}
}

StackBlitz (https://stackblitz.com)
Ionic Angular StackBlitz: https://stackblitz.com/edit/ionic-v5-angular-iondatetime

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 6.11.7 (C:\Users\dibye\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 5.3.4
   @angular-devkit/build-angular : 0.901.12
   @angular-devkit/schematics    : 10.0.7
   @angular/cli                  : 9.1.12
   @ionic/angular-toolkit        : 2.3.3

Capacitor:

   Capacitor CLI   : 2.0.0
   @capacitor/core : 2.0.1

Utility:

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

System:

   NodeJS : v12.16.2 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.4
   OS     : Windows 10
@ionitron-bot ionitron-bot bot added the triage label Sep 28, 2020
@liamdebeasi
Copy link
Contributor

Thanks for the issue. I can reproduce this. This appears to be a regression in v5.3.3: https://codepen.io/liamdebeasi/pen/BaKEVra cc @brandyscarney

@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Sep 28, 2020
@liamdebeasi liamdebeasi changed the title bug: bug: HH:mm does not let you select hours Sep 28, 2020
@brandyscarney brandyscarney added this to the 5.3.5 milestone Oct 5, 2020
@ionitron-bot
Copy link

ionitron-bot bot commented Nov 4, 2020

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 Nov 4, 2020
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
3 participants