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

Datetime picker's default value ignores min datetime #25291

Closed
manu2504 opened this issue May 16, 2022 · 2 comments
Closed

Datetime picker's default value ignores min datetime #25291

manu2504 opened this issue May 16, 2022 · 2 comments
Labels

Comments

@manu2504
Copy link

Ionic version:
[] 4.x
[] 5.x
[x] 6.x

I'm submitting a ...
[x] bug report
[ ] feature request

Current behavior:
The datetime picker's default time is now, even if the min attribute is in the future.

It is still possible to set the default value manually, by setting [value] = min_time, but one would expect the default value cannot be lower than the min time.

Expected behavior:
The default time should not be lower than the min datetime. It should correspond to the min datetime if the min datetime is in the future.

Steps to reproduce:
Create a ion-datetime component. Set its min attribute in the future (example '2022-05-16T18:20:00Z' if testing on 2022-05-16T18:05:00Z). Observe the datetime picker (currently selected on date = today and time = now):
Screenshot 2022-05-16 at 18 05 29

Related code:

<ion-datetime hour-cycle="h23" [min]="2022-05-16T18:20:00Z"></ion-datetime>

Ionic info:

Ionic:

   Ionic CLI                     : 6.18.1 (/Users/macbookpro/.nvm/versions/node/v12.22.1/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 6.0.9
   @angular-devkit/build-angular : 13.2.5
   @angular-devkit/schematics    : 13.2.5
   @angular/cli                  : 13.2.5
   @ionic/angular-toolkit        : 6.0.0

Capacitor:

   Capacitor CLI      : not installed
   @capacitor/android : not installed
   @capacitor/core    : not installed
   @capacitor/ios     : not installed

Utility:

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

System:

   NodeJS : v12.22.1 (/Users/macbookpro/.nvm/versions/node/v12.22.1/bin/node)
   npm    : 6.14.16
   OS     : macOS Big Sur
@ionitron-bot ionitron-bot bot added the triage label May 16, 2022
@liamdebeasi liamdebeasi self-assigned this May 16, 2022
@liamdebeasi
Copy link
Contributor

Thanks for the issue. I am going to close this as a duplicate of #24881.

@liamdebeasi liamdebeasi removed their assignment May 16, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Jun 15, 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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 15, 2022
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

2 participants