Html DateTimeInput

Invoke the val method of the jqxDateTimeInput. Author: http://jqwidgets.com

HTML

<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/jquery-widgets-demo/jqwidgets/globalization/globalize.js"></script>
<div style="margin: 10px;" id='jqxDateTimeInput1'></div>
<div style="margin: 10px;" id='jqxDateTimeInput2'></div>

<button style="margin: 10px;" id='jqxBTN'>Calculate</button>

JavaScript

$("#jqxDateTimeInput1").jqxDateTimeInput({
     width: '250px',
     height: '25px',
     showTimeButton: true,
     formatString: "dd/MM/yyyy h:mm tt",
     theme: 'energyblue'
});
$("#jqxDateTimeInput2").jqxDateTimeInput({
     width: '250px',
     height: '25px',
     showTimeButton: true,
     formatString: "dd/MM/yyyy h:mm tt",
     theme: 'energyblue'
});

   $("#jqxBTN").jqxButton({
     width: '250px',
     height: '25px',
     theme: 'energyblue'
 });

$("#jqxBTN").on("click", function(){
  
  var date1 = $('#jqxDateTimeInput1').val('date');
  var date2 = $('#jqxDateTimeInput2').val('date');
  var difference = date2 - date1;

  alert("The difference ini milliseconds: " + difference);
});