Twipped / Kalendae

A javascript date picker that just works.
MIT License
1.99k stars 285 forks source link

Kalendae fails to init calendar when default value present #153

Closed fgafford closed 9 years ago

fgafford commented 9 years ago

Kalendae is not able to initiate when the target field has a default value.

Error: Uncaught TypeError: Cannot read property 'subtract' of undefined

Cause: Error is caused because call to setSelected (kalendae.standalone.js:61) eventually accesses the this.viewStartDate property before it has been set in (kalendae.standalone.js:71).

Stack Trace: Uncaught TypeError: Cannot read property 'subtract' of undefined

Kalendae.makeSelectedDateVisible @ kalendae.standalone.js:459 Kalendae.addSelected @ kalendae.standalone.js:419 Kalendae.setSelected @ kalendae.standalone.js:406 Kalendae @ kalendae.standalone.js:61 Kalendae.Input @ kalendae.standalone.js:854 .... [ calling code]

Resolution: The viewStateDate needs to be set before calling setSelected. Diff of needed change:

I have already made this change. Please go ahead and grant contributor privileges so that I am able to push branch and create a pull request to the branch.

Twipped commented 9 years ago

I'm sorry, but I'm not going to grant you contributor access just so you can open a PR. Please make a PR against the dev branch from a branch on your own fork.

fgafford commented 9 years ago

Sorry, still getting used to the gitlab pull-request workflow.

Twipped commented 9 years ago

Closed by #157