Skip to content

<ion-datetime> allows non existing dates to select #12533

Closed

Description

@wojtal26

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[] 2.x
[X] 3.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:
User is able to select non existing date for example 06/31/2017 or 02/29/2017

Expected behavior:
User should not be able to select non existing dates.

Steps to reproduce:
Add to you template ion-datetime

    <ion-datetime pickerFormat="YYYY-MM-DD" displayFormat="YYYY-MM-DD"  max="{{maxDate}}" min="{{minDate}}"
                      [(ngModel)]="temDate" (ionChange)="moveForward()" placeholder="{{selectedDate}}"></ion-datetime>
  1. Select date for example 07/31/2017, click 'Done' button. Correct date should be printed on .

  2. Click on to change date.

  3. Very carefully change month to June. The day should be still 31st.

  4. Click done button. The date should be printed on .

Other information:
I have some screenshot with this bug.

Ionic info: :

global packages:

    @ionic/cli-utils : 1.5.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.5.0

local packages:

    @ionic/app-scripts              : 1.3.12
    @ionic/cli-plugin-cordova       : 1.4.1
    @ionic/cli-plugin-ionic-angular : 1.3.2
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v6.10.3
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 3.10.10

Activity

  1. wojtal26 commented on Aug 1, 2017

    @wojtal26
    Author

    1
    2
    3
    4

  2. jgw96 commented on Aug 1, 2017

    @jgw96
    Contributor

    Thanks for opening an issue with us, we will look into this.

  3. brassier commented on Aug 24, 2017

    @brassier

    Just saw this. Here's a quick plunker demonstrating the issue. From the given datetime, just change the month to June. Notice it allows June 31.

    http://plnkr.co/ISksKiSCNjRdVW6jZxt3?p=preview

  4. kensodemann commented on Oct 30, 2017

    @kensodemann
    Contributor

    Issue #13287 also has some good sample code demonstrating this issue.

  5. olivercodes commented on Oct 30, 2017

    @olivercodes
    Contributor

    Useful Gif further demonstrating the issues:
    ezgif com-gif-maker

    @Michazzz if you want to cleanup the thread a bit, feel free to repost my gif up top, and then you can get rid of all of those images.

  6. anooprehman commented on Nov 10, 2017

    @anooprehman

    Saw a similar issue in #12319 which has a Fix commit.

  7. ionitron-bot commented on Nov 28, 2018

    @ionitron-bot

    This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

    If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!

    Thank you for using Ionic!

  8. ionitron-bot commented on Nov 28, 2018

    @ionitron-bot

    Issue moved to: ionic-team/ionic-v3#227

  9. locked and limited conversation to collaborators on Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions