Skip to content

ion-datetime allows invalid dates #13287

Closed

Description

@olivercodes

Ionic version: (check one with "x")
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x] 3.x
[ ] 4.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request

Please do not submit support requests or "How to" questions here. Instead, please use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

  1. When the datetime picker opens, if you select January 31, then scroll the month to February, it stays on 31st. You can click done, and the date saves as February 31st. Then, when you reopen the picker, the options only go to 28, even though the ngModel value is 31st.

  2. Set the picker to February 28. Save it. Then open the picker again. Move the Month field to January. The day options do not update to allow up to 31, they stay limited to 28th.

  3. Set the picker to January 28th. Save it. Then open the picker again. Move the Month field to February. The day options do not update to only allow up to 28, they stay limited up to the 31st.

Expected behavior:
The picker should be appropriately updated to show the correct number of days in a given month, for all months. It should not be possible to save dates such as Feb 31.

Steps to reproduce:
ezgif com-gif-maker

Related code:
https://github.com/devnetics/datetime-demo

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

dev/myapp [master] » ionic info

cli packages: (/Users/a6277/.nvm/versions/node/v6.11.0/lib/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

local packages:

    @ionic/app-scripts : 3.0.1
    Ionic Framework    : ionic-angular 3.8.0

System:

    Node : v6.11.0
    npm  : 3.10.10
    OS   : macOS Sierra

Misc:

    backend : legacy

Activity

  1. olivercodes commented on Oct 30, 2017

    @olivercodes
    ContributorAuthor

    Sorry about the slow gif, updated it with a faster one.

  2. kensodemann commented on Oct 30, 2017

    @kensodemann
    Contributor

    Hello! Thank you for opening an issue with us! I am closing this issue because it is a duplicate of Issue #12533. Please track that issue for further updates. Also please comment on that issue with any new information you may have to share. Thank you for using Ionic

  3. olivercodes commented on Oct 30, 2017

    @olivercodes
    ContributorAuthor

    Ah thank you!

  4. francescotaioli commented on Aug 2, 2018

    @francescotaioli

    anyone know how to fix this? @olivercodes i didn't find anything

  5. ionitron-bot commented on Sep 1, 2018

    @ionitron-bot

    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.

  6. locked and limited conversation to collaborators on Sep 1, 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