Skip to content

Instantly share code, notes, and snippets.

@anestan
Created July 13, 2014 15:42
Show Gist options
  • Save anestan/52c3de6ea023b180c04b to your computer and use it in GitHub Desktop.
Save anestan/52c3de6ea023b180c04b to your computer and use it in GitHub Desktop.
function days jquery ui datetimepicker
function days() {
var a = $("#datepicker_start").datepicker('getDate').getTime(),
b = $("#datepicker_end").datepicker('getDate').getTime(),
c = 24*60*60*1000,
diffDays = Math.round(Math.abs((a - b)/(c)));
console.log(diffDays); //show difference
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment