# ユーザーカスタムフィールド内の Datepicker

**URL:** <https://meta.discourse.org/t/datepicker-in-a-user-custom-field/83550>\
**Category:** Development\
**Tags:** user-custom-fields\
**Created:** [2018 年 3 月 22 日午後 12:42 UTC](https://meta.discourse.org/t/datepicker-in-a-user-custom-field/83550 "2018-03-22T12:42:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Vaping\_Community](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vaping_community/32/89248_2.png) [@Vaping\_Community](https://meta.discourse.org/u/Vaping_Community)\
**Post date:** [2018 年 3 月 22 日午後 12:42 UTC](https://meta.discourse.org/t/datepicker-in-a-user-custom-field/83550/1 "2018-03-22T12:42:55Z")

</div>

カスタムユーザーフィールドにクラスを追加して、日付選択器を使用することは可能でしょうか。

ありがとうございます

**編集 - 最終的な解決策:**

```plaintext
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">

<script type="text/discourse-plugin" version="0.8">
$( document ).ajaxComplete(function() {
    api.onPageChange((url) =>{
        if (url.match(/\/preferences\/profile/)) {
            $( function() {
                var control = $("label:contains('Quit Smoking Date')").next('div.controls');
                $(control).find('input').addClass('quitDate');
                $( ".quitDate" ).datepicker();
            });
         }
    });
});
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/datepicker-in-a-user-custom-field/83550)._
