JSFiddle - React, Tailwind, and code Playground

by Sivasakthi Chandrasekaran

HTML

<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<input class="datepicker" />

JavaScript

$(document).ready(function() {
  $(".datepicker").datepicker({
    showOn: 'focus',
    showButtonPanel: true,
    closeText: 'Clear', // Text to show for "close" button
    onClose: function() {
      var event = arguments.callee.caller.caller.arguments[0];
      // If "Clear" gets clicked, then really clear it
      if ($(event.delegateTarget).hasClass('ui-datepicker-close')) {
        $(this).val('');
      }
    }
  });
});