jquery date in table

by Joe

HTML

<script
  src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"
  integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30="
  crossorigin="anonymous"></script>
<div class="col-md-12 table-responsive">
  <table id="example1" class="table table-bordered table-striped">
    <thead>
      <tr>
        <th class="text-center">
          Narration*
        </th>
        <th class="text-center">
          Debit*
        </th>
        <th class="text-center">
          Credit
        </th>
        <th class="text-center">
          Realise*
        </th>
        <th class="text-center">
          Real.Date*
        </th>
      </tr>
    </thead>
    <tbody>
      <tr id="rcpt_mainrow">
        <td>
          <input type="text" id="br_narrate" placeholder='Some Text here' class="form-control" readonly />
        </td>
        <td>
          <input type="number" id="rcptDebit" value="" placeholder='Debit Amount' data-action="sumDebit" class="form-control" readonly />

        </td>
        <td>
          <input type="number" id="rcptCredit" placeholder='Credit Amount' data-action="sumCredit" class="form-control" readonly />
        </td>
        <td>
          <input type="checkbox" id="tableCbox" name="tableCheck" value="yes">
          <label class="tableBox" for="tableCbox"></label>
        </td>
        <td>
          <input type="text" class="form-control tableJ" id="rcpt_vochDate" />
        </td>
      </tr>
    </tbody>
  </table>
</div>

JavaScript

$(document).ready(function() {
    $("#rcpt_vochDate").datepicker({ dateFormat: "dd/mm/yy" }).datepicker("setDate", new Date());
});

$(document).ready(function() {
  $('table').on('focus', 'input.tableJ:not(.hasDatepicker)', function() {
    $('.tableJ').datepicker();
  });
});