ionic-team / ionic-v3

The repo for Ionic 3.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
127 stars 85 forks source link

[Ionic V3] ion-datetime picker show incorrect options when use 12-hour #811

Open ionitron-bot[bot] opened 5 years ago

ionitron-bot[bot] commented 5 years ago

Original issue by @tietthinh on 2018-12-05T04:45:28Z

Bug Report

Ionic Info Ionic:

ionic (Ionic CLI) : 4.4.0 (C:\Users\thinh.tran\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.2.1

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : not available Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.5, (and 14 other plugins)

System:

NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe) npm : 5.6.0 OS : Windows 10

Describe the Bug

ion-datetime option goes wrong as I use 12-hour with max and min option, for example: 12:00 am to 9:00 am but the option AM and PM still selectable and it can select unexpected time.

Steps to Reproduce Steps to reproduce the behavior:

  1. In html

<ion-datetime #picker datePicker="hh:mm A"> </ion-datetime>

  1. With min and max from component:

this.picker.min= moment().startOf('day').format()

this.picker.max = moment().format()

Expected Behavior The selector should be flexible as we select hour or AM PM

CassioCostaKL commented 5 years ago

Has anyone fixed this problem?