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: ion-datetime opening value when "min" is set to a future date. #23046

Closed
pg17 opened this issue Mar 15, 2021 · 2 comments
Closed

bug: ion-datetime opening value when "min" is set to a future date. #23046

pg17 opened this issue Mar 15, 2021 · 2 comments
Labels

Comments

@pg17
Copy link

pg17 commented Mar 15, 2021

Ionic version:
[x] 5.5.5

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

Current behavior:
When setting the "min" attribute of ion-datetime to a date in the future but before the current day of month (ie: if today is
2021-03-15 and you set the min date to 2022-02-01 (so in the future but to a day before march 15th), the preselected date when opening the component is set to the current day of month in the future (2022-03-15 in our example).

Expected behavior:
When setting a min value in the future, the date displayed on opening the component (when no value is selected) should (in my opinion) be that min date. In the example above that would be 2022-02-01.

Steps to reproduce:

<!-- min value should be set to any year in the future but to a day and month prior to those of the current day -->
<ion-datetime min="2022-02-01"></ion-datetime>

Other information:
While I think the expected behavior I proposed would be reasonable I understand this is debatable. Being able to set the opening / pre-selected value (as discussed here #20532) could be an even better solution.

Ionic info:

Ionic:

   Ionic CLI                     : 6.13.1 (C:\Users\pg17\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework               : @ionic/angular 5.5.5
   @angular-devkit/build-angular : 0.1100.7
   @angular-devkit/schematics    : 10.0.8
   @angular/cli                  : 11.2.2
   @ionic/angular-toolkit        : 2.3.3

Capacitor:

   Capacitor CLI   : 2.4.0
   @capacitor/core : 2.4.0

Utility:

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

System:

   NodeJS : v14.16.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.14.11
   OS     : Windows 10
@liamdebeasi
Copy link
Contributor

Thanks for the issue. I agree that this is a bug. We are tracking our datetime issues in #16630, so I will close this issue out and add it to our datetime tracker I linked to above.

@ionitron-bot
Copy link

ionitron-bot bot commented Apr 14, 2021

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 Apr 14, 2021
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