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

Datetime not working for dayValues attribute #7190

Closed
chandanch opened this issue Jul 4, 2016 · 6 comments · Fixed by #9708
Closed

Datetime not working for dayValues attribute #7190

chandanch opened this issue Jul 4, 2016 · 6 comments · Fixed by #9708
Assignees
Milestone

Comments

@chandanch
Copy link

chandanch commented Jul 4, 2016

Short description of the problem:

DateTime not working when the dayValues attribute is added

What behavior are you expecting?

Should show the Date picker with the specified days

When using the dayValues attribute in something like this:

<ion-item>
       <ion-label>Date</ion-label>
       <ion-datetime monthValues="6,7,8" yearValues="2014,2015" dayValues="01,02,03,04,05,06" displayFormat="DD/MMM/YYYY" [(ngModel)]="myDate"></ion-datetime>
</ion-item>

i get the error as:

Cannot set property 'disabled' of undefined
at DateTime.validate (datetime.js:486)
at DateTime.open (datetime.js:350)
at DateTime._click (datetime.js:313)

ORIGINAL EXCEPTION: TypeError: Cannot set property 'disabled' of undefined
ORIGINAL STACKTRACE:
TypeError: Cannot set property 'disabled' of undefined
at DateTime.validate (http://localhost:8100/build/js/app.bundle.js:48564:48)
at DateTime.open (http://localhost:8100/build/js/app.bundle.js:48428:14)
at DateTime._click (http://localhost:8100/build/js/app.bundle.js:48391:14)
at DebugAppView.ViewAnalyticsRender0.handleclick_385_1 (AnalyticsRender.template.js:4870:36)
at http://localhost:8100/build/js/app.bundle.js:31774:24
at http://localhost:8100/build/js/app.bundle.js:41260:36
at http://localhost:8100/build/js/app.bundle.js:41330:111
at ZoneDelegate.invoke (http://localhost:8100/build/js/zone.js:323:29)
at Object.onInvoke (http://localhost:8100/build/js/app.bundle.js:36931:41)
at ZoneDelegate.invoke (http://localhost:8100/build/js/zone.js:322:35)
ERROR CONTEXT:
[object Object]Zone.runTask @ zone.js:260ZoneTask.invoke @ zone.js:423

Plunkr: http://plnkr.co/edit/RL5REAhfQdAoEdCjmLj3?p=preview

Which Ionic Version? 1.x or 2.x
2.0.0-beta.31

Plunker that shows an example of your issue

http://plnkr.co/edit/RL5REAhfQdAoEdCjmLj3?p=preview

Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local:
Ionic CLI Version: 2.0.0-beta.31
Ionic App Lib Version: 2.0.0-beta.17
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.4.5
Xcode version: Xcode 7.3.1 Build version 7D1014

@chandanch
Copy link
Author

Any Updates on this?

@patrickpereira
Copy link

Same issue here!

@CharlyTheDog
Copy link

Same issue!

@skill83
Copy link

skill83 commented Dec 6, 2016

On RC3 is still not working, i cannot set dayValues:

schermata 2016-12-06 alle 10 46 43

@manucorporat manucorporat self-assigned this Dec 6, 2016
@manucorporat manucorporat added this to the 2.0.0-rc.5 milestone Dec 6, 2016
manucorporat added a commit that referenced this issue Dec 9, 2016
brandyscarney pushed a commit that referenced this issue Dec 19, 2016
brandyscarney added a commit that referenced this issue Dec 19, 2016
…exist

When the current year does not exist in yearValues, it was disabling
months when it shouldn’t - this commit fixes that so all of the months
are enabled.

Closes #7190
brandyscarney added a commit that referenced this issue Dec 19, 2016
* fix(datetime): dayValues attribute

fixes #7190

* fix(datetime): default to the first year if the current year doesn't exist

When the current year does not exist in yearValues, it was disabling
months when it shouldn’t - this commit fixes that so all of the months
are enabled.

Closes #7190

* fix(datetime): only set the year to the first option if yearCol exists
@brandyscarney brandyscarney self-assigned this Dec 19, 2016
@brandyscarney
Copy link
Member

Thanks for the issue and sorry for the wait! This will be fixed in the rc.5 release, but I also released a nightly version with the fix if you want to try it out sooner:

npm install --save [email protected]

manucorporat added a commit to manucorporat/ionic that referenced this issue Jan 18, 2017
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 5, 2018

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 Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants