Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

init datepicker without model value bug #5417

Closed
trickpattyFH20 opened this issue Feb 5, 2016 · 14 comments
Closed

init datepicker without model value bug #5417

trickpattyFH20 opened this issue Feb 5, 2016 · 14 comments

Comments

@trickpattyFH20
Copy link
Contributor

If a popup datepicker is initialized without a model value, everything functions as expected.

If an inline datepicker is initialzed without a model value, the datepicker does not display anything (only the arrows are shown)

http://plnkr.co/edit/13h4rpa2b3xUbSXxnuMO?p=preview
comment on line 4 of example.js in the UIB datepicker example plunkr reproduces the bug

@wesleycho
Copy link
Contributor

This is already fixed in master via 4b2ee0f

@trickpattyFH20
Copy link
Contributor Author

@wesleycho I don't think it is actually, this seems like a different issue.

I built the latest version from the master branch and updated it in the plunkr.
http://plnkr.co/edit/13h4rpa2b3xUbSXxnuMO?p=preview

This seems to be a different issue and actually is a regression that now affects both inline AND popup datepickers in the current master branch.

@wesleycho
Copy link
Contributor

The fix is unreleased, and will be in 1.2.0 - that Plunker does not demonstrate it happening with the fix in.

@trickpattyFH20
Copy link
Contributor Author

@wesleycho .... I downloaded the master zip and built the latest version myself and included that file as the UIB source in that plunkr...

@icfantv
Copy link
Contributor

icfantv commented Feb 5, 2016

@trickpattyFH20, sure looks like you're including 1.1.2 in your <head> rather than the SNAPSHOT build as a separate file.

@trickpattyFH20
Copy link
Contributor Author

ui-bootstrap-tpls-1.2.0-SNAPSHOT.min.js was the name of the file that was built... I renamed it to latestuibbuild.js in the plunkr.... I can rename it back to ui-bootstrap-tpls-1.2.0-SNAPSHOT.min.js in the plunkr if you'd like @wesleycho @icfantv

Also it says * Version: 1.2.0-SNAPSHOT - 2016-02-05 in the comments of the file I built...

The bug is still there... if the model value is undefined the datepickers do not display.

Maybe it would help to re-open this issue so we could get some other eyes on the bug. I don't have time to dig in to the source today.

@icfantv
Copy link
Contributor

icfantv commented Feb 5, 2016

the plunker you had before was not correct, hence my comment. it had only the HTML file and the example.js file. you must have forgotten to save it.

@trickpattyFH20
Copy link
Contributor Author

ah... yes probably didn't save the plunkr. @icfantv
unless I am mistaken in some other aspect, I still see the bug I mentioned earlier.

@icfantv
Copy link
Contributor

icfantv commented Feb 5, 2016

Agreed. Even if you set $scope.dt = null or $scope.dt = undefined the error is present. Could you please replace the SNAPSHOT contents with the uncompressed version? It helps us debug and test potential fixes. Thanks.

@icfantv
Copy link
Contributor

icfantv commented Feb 5, 2016

@wesleycho, unless I'm missing something obvious, it sure looks like this is still an issue.

@icfantv
Copy link
Contributor

icfantv commented Feb 5, 2016

Wait a second. You're getting errors in your console. This is not an issue.

@icfantv icfantv closed this as completed Feb 5, 2016
@icfantv
Copy link
Contributor

icfantv commented Feb 5, 2016

Please check/fix the errors and we'll go from there.

@trickpattyFH20
Copy link
Contributor Author

@icfantv

  • switched plunkr to unminified SNAPSHOT
  • the console errors come from line 2187 of ui-bootstrap-tpls-1.2.0-SNAPSHOT.js

http://plnkr.co/edit/13h4rpa2b3xUbSXxnuMO?p=preview

looks like we still see the bug when the datepicker is not initialized with a date.
to remove the console errors, you can initialize it with a date (uncomment line 4 of example.js)

@trickpattyFH20
Copy link
Contributor Author

@icfantv
karma unit tests are failing for my local build and for the travis build on this pr because of an error from another component...

looks like the same error happened in @wesleycho 's latest build as well https://travis-ci.org/angular-ui/bootstrap/builds/107235596

any idea what this error means and how to resolve/merge the fix into this pr so that the travis build is successful?

wesleycho pushed a commit that referenced this issue Feb 5, 2016
- Fallback to current date if model not present

Closes #5418
Fixes #5417
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants