# محدد التاريخ في حقل مخصص للمستخدم

**URL:** https://meta.discourse.org/t/datepicker-in-a-user-custom-field/83550
**Category:** Development
**Tags:** user-custom-fields
**Created:** [22 مارس 2018، 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:** 5

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [22 مارس 2018، 8:05م UTC](https://meta.discourse.org/t/datepicker-in-a-user-custom-field/83550/5 "2018-03-22T20:05:13Z")

</div>

Hey @Vaping_Community 🙂 Glad to see you figured out a solution!

For detecting the profile preferences page, this should work:

```plaintext
<script type="text/discourse-plugin" version="0.8">
    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)._
