Implement reusable datepicker component

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

The datepicker is currently used in at least 3 places and in order to implement gitlab-ce#17495 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:

  1. https://gitlab.com/gitlab-org/gitlab-ce/blob/a87b229b5d6da23e12e34d899f824f1f7e2dc28a/app/views/profiles/personal_access_tokens/index.html.haml#L97
  2. https://gitlab.com/gitlab-org/gitlab-ce/blob/cc971f03096b8298567caf0b9e0ae738bead03a7/app/views/groups/milestones/new.html.haml#L51
  3. https://gitlab.com/gitlab-org/gitlab-ce/blob/aaa9509d120524573085e94af9de5cdde83e3271/app/assets/javascripts/due_date_select.js
  4. 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 gitlab-ce#18437

Edited by 🤖 GitLab Bot 🤖