Ensure DOM input field gets updated whenever the `selectedDate` changes.

At the moment, when you navigate through the months the `selectedDate` gets updated but the DOM input field to which the datepicker is attached doesn't. This pull request fixes that.