jquery datepicker add clear button

Using jquery ui datepicker, i used to do this


beforeShow: function( input, obj ) {

      setTimeout(function() {

        var buttonPane = $( input ).datepicker( "widget" ).find( ".ui-datepicker-buttonpane" );        

        $("#BCL").hide();

        $("#BTDY").hide();

        $( "<button>", {

              text: "Clear",

              click: function() {

                $(input).val('');                

              }

          }).addClass('ui-state-default ui-corner-all').appendTo( buttonPane );

        }, 1 );

  },

The code above add a clear button to clear date selection.

How to do this in for yii\jui\DatePicker?