Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Setting min/max on datetime component does not work with 12-hour clock; am/pm column. #70

Open
ionitron-bot bot opened this issue Nov 1, 2018 · 0 comments
Labels

Comments

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 1, 2018

Ionic version: (check one with "x")
[ ] 1.x
[x] 2.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
Use 12-hour time with a am/pm column, and min/max time, e.g.

<ion-datetime displayFormat="hh:mm a" min="01:20" max="13:45"></ion-datetime>

Hours/minutes columns are not shown.

Expected behavior:
Hours/minutes columns should be displayed and limited to 01:20 am and 01:45 pm.

Other information:
I was working on a pull request that allowed specifying a min/max time. My code was obviated by ionic-team/ionic-framework@afd99ba

I have some insight into how to fix.

  1. You will need to adjust the 12 hour clock to run from 12 to 11 rather than from 1 to 12. I.e. [12, 1, 2, 3, ..., 10, 11]

  2. You will need to check am/pm min/max values before checking hour values, i.e. between day and hour.

I am happy to contribute a pull request that does this, but it will take me a few days because my old code is now incompatible with the new approach.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

0 participants