JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<p>Choose your dates and hit <em>go</em>.</p>
<input type="text" id="arr_date" />
<input type="text" id="dep_date" />
<input type="text" id="hasil" />
<button class="button">go</button>
JavaScript
$(function() {
$( "#arr_date" ).datepicker({ dateFormat: 'dd-mm-yy' });
$( "#dep_date" ).datepicker({ dateFormat: 'dd-mm-yy' });
});
$('.button').click(function() {
var start = $('#arr_date').datepicker('getDate');
var end = $('#dep_date').datepicker('getDate');
var days = (end - start)/1000/60/60/24;
alert(days);
$('#hasil').val(days);
});