title: JQuery Datepicker Oracle APEX
body: <p>I hope you are well.</p>
  <p>I have an Oracle APEX form (v20) with a DatePicker field.</p>
  <p>I only want to display a pop-up when the user clicks on Sunday.</p>
  <p>My code :</p>
  <pre><code>var selector = $(&quot;#&quot; + $(this.triggeringElement).parent().find('.apex-item-datepicker').attr('id'));
  
  function showday() {
      day_no = new Date($(this).val()).getDay();
      if(day_no == 0) { //sundays
          alert(&quot;its sunday&quot;);
      }
  }
  
  selector.datepicker(&quot;option&quot;, {
      onClose : showday
  }).next(&quot;.ui-datepicker-trigger&quot;).addClass(&quot;a-Button a-Button--calendar&quot;);
  </code></pre>
  <p>I have a functional code which is the following but since the APEX datepicker it doesn't work like the demo below: <a href="http://jsfiddle.net/D4AGz/104/" rel="nofollow noreferrer">http://jsfiddle.net/D4AGz/104/</a></p>
  <p>it works in a way that I can't explain, more or less randomly, for example yesterday (before 00h) I had the following result : the pop-up is only displayed on the following Monday.</p>
  <p>Thank you in advance for your help, I wish you a nice day.</p>