Implement reusable datepicker component
The datepicker is currently used in at least 3 places and in order to implement #17495 (closed) we will need it in three additional places. That's why I believe that it would be awesome to have a reusable component for the datepicker which requires minimal amount of boilerplate code to initialize.
Let's take a look how it is done now:
- https://gitlab.com/gitlab-org/gitlab-ce/blob/a87b229b5d6da23e12e34d899f824f1f7e2dc28a/app/views/profiles/personal_access_tokens/index.html.haml#L97
- https://gitlab.com/gitlab-org/gitlab-ce/blob/cc971f03096b8298567caf0b9e0ae738bead03a7/app/views/groups/milestones/new.html.haml#L51
- https://gitlab.com/gitlab-org/gitlab-ce/blob/aaa9509d120524573085e94af9de5cdde83e3271/app/assets/javascripts/due_date_select.js
- https://gitlab.com/gitlab-org/gitlab-ce/blob/aaa9509d120524573085e94af9de5cdde83e3271/app/assets/javascripts/issuable_form.js#L32
There is some duplication here and the code looks like tied to one specific input name. This issue is probably related to #18437 (closed)