mdehoog / Semantic-UI-Calendar

Calendar module for Semantic UI
MIT License
805 stars 126 forks source link

Angular js 1 - Input date not working properly for a set date #66

Open brianwfl88 opened 7 years ago

brianwfl88 commented 7 years ago

There's an issue with my date being erased after initializing the calendar plugin. After the angular loaded the model into ng-model, the date is not showing up.

How can i stop this? Or any method to set a default date?

-- update --

I used timeout to call the calendar plugin after angularjs's setting the value, it work as expected. However, when I did not select any date after popup closed, the input date got erased.

This is unexpected behavior I am encountering.

mdehoog commented 7 years ago

Please provide a JSBin that reproduces the issue, thanks.

douglasg14b commented 7 years ago

I first encountered this when trying to use this calendar in my angular project. I made a pull request last year on the old repo and a comment on the old issue thread:

https://github.com/mdehoog/Semantic-UI/pull/3

It's very much not ideal to have to set the calendar date after it has been initialized in an angular directive or something similar. It forces the use of jankey solutions such as timeout to try and set the value instead of being able to set it programatically from the start.