ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

ionic2 bug(ion-datetime):day values won't refresh after changing month values

Open emeryao opened this issue 10 years ago • 6 comments

so there will be some strange values like 2016-02-31 see below image

  • ionic info
Cordova CLI: 6.1.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.7
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS:Win10 x64
Node Version: v6.2.0

emeryao avatar May 26 '16 09:05 emeryao

Hell, thanks for opening an issue with us. I am sorry but iIam not fully understanding the issue here. Would you mind explaining the issue a little more? Also, if you could make a plunker that demonstrates this issue that would be great! Thanks for using Ionic!

jgw96 avatar May 26 '16 14:05 jgw96

hi @jgw96, here is the steps to reproduce this issue:

  1. create a ion-datetime with the html below
<ion-item>
  <ion-label>Date</ion-label>
  <ion-datetime displayFormat="YYYY-MM-DD"> </ion-datetime>
</ion-item>

2.click the date on the page and the datetime picker popup like this: image 3. scroll down the day value to 30
image 4. scroll down the month value to 2 and the day value is still 30 image
5. click the DONE button then the date of 2016-02-30 applied and this is weird because Feb does not have the 30th.

So, I think this is a bug of the ion-datetime. The day value range should refresh after the month value changes.

emeryao avatar May 27 '16 04:05 emeryao

+1 facing same issue

tpruthi avatar May 27 '16 10:05 tpruthi

This should be fixed in the nightly version. @jgw96 can you please verify that? Thanks

adamdbradley avatar Jun 01 '16 13:06 adamdbradley

Hello, I have also been facing this issue.

The problem is whenever you change to a different month. The ion-datetime will keep the amount of days from the first month instead of updating for the new selected month.

If you go from january to february, you will see 31 days for february. If you go from june to July you will see 30 days for July.

Is this issue fixed in the beta.8 release?

Thanks for the awesome work!!

ggardiles avatar Jun 07 '16 17:06 ggardiles

@ggardiles Thanks! This issue is fixed in the beta.8 release. You can read the changelog here to see all the changes and updates. Thanks for using Ionic!

jgw96 avatar Jun 07 '16 17:06 jgw96