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

[Ionic4-beta.6] Datetime restrictions based on maxDate do not update while modal is open #15452

Closed
UVKApps opened this issue Sep 3, 2018 · 7 comments

Comments

Projects
None yet
5 participants
@UVKApps
Copy link

commented Sep 3, 2018

Bug Report

Ionic Info

Ionic:

   ionic (Ionic CLI)          : 4.1.1 (C:\Users\Dani\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.6
   @angular-devkit/core       : 0.7.4
   @angular-devkit/schematics : 0.7.4
   @angular/cli               : 6.1.4
   @ionic/ng-toolkit          : 1.0.7
   @ionic/schematics-angular  : 1.0.5

System:

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

Describe the Bug
The fields in the selector do not update while the popup is open when a max value is set.
Example: max value is 15.09.2018 (dd.MM.yyyy), so only 1-15d in month 9, 1-9m in year 2018 should be able to be selected, while in other months all days, and in other years all months should be available for selection. Change the year to 2017, fields do not update and month is still only 1-9 available. Accept the date, reopen the modal and you can select all months.
Day is completely ignored there are always 31 days available for every month.

Steps to Reproduce
Steps to reproduce the behavior:

  1. create datetime with maxDate set.
  2. open modal
  3. change date around to a date where there should be more selectable options based on maxDate restriction.
  4. restriction did not update
  5. accept date
  6. reopen modal, restrictions did update

Expected Behavior
Restrictions update while selecting date.

@ionitron-bot ionitron-bot bot added the triage label Sep 3, 2018

@paulstelzer

This comment has been minimized.

Copy link
Collaborator

commented Dec 4, 2018

Does this issue still exist in beta.17?

@ionitron-bot ionitron-bot bot removed the triage label Dec 4, 2018

@UVKApps

This comment has been minimized.

Copy link
Author

commented Dec 4, 2018

I updated to beta.17 and the issue is still present.

I startet a new project from template to record a .gif showing the issue.

datetime

Whats happening in this gif:
max for ion-datetime is set to "2018-07-08" and min is set to "2016-01-01".
when selecting in the year 2018 months and days above 07-08 are present but can't be selected.
After switching to a previous year where they should be able to be selected they are still shown but can't be selected.
Closing the modal on year 2016 and reopening it lets me select all dates even in the year 2018. Leading me to select 2018-12-31 at the end. Reopening then and the date jumps to 2018-07-08

Edit: max and min attributes are set via template binding.

<ion-item>
    <ion-label position="floating">Date</ion-label>
    <ion-datetime displayFormat="D.MM.YYYY" pickerFormat="D MM YYYY" [min]="minDate" [max]="maxDate" [(ngModel)]="date"></ion-datetime>
</ion-item>

@ionitron-bot ionitron-bot bot added triage and removed needs: reply labels Dec 4, 2018

@gregor-srdic

This comment has been minimized.

Copy link

commented Dec 5, 2018

I am also experiencing this issue in 4.0.0-beta.17

@paulstelzer

This comment has been minimized.

Copy link
Collaborator

commented Dec 5, 2018

Thanks for your response and confirming it. I already added it as bug, so it should fixed until the v4 release :)

@shomid

This comment has been minimized.

Copy link

commented Jan 9, 2019

I have also this issue in 4.0.0-rc-0

@liamdebeasi

This comment has been minimized.

Copy link
Member

commented Feb 12, 2019

Hi there,

Thanks for the issue! I’ve added this to issue #16630 to keep track of. We’re going to close out the individual issues and address all of the Datetime issues at once. We’re not forgetting about your issue, just trying to keep them all together.

Thanks for using Ionic!

@ionitron-bot

This comment has been minimized.

Copy link

commented Mar 14, 2019

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 Mar 14, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.