Created
January 28, 2014 10:03
-
-
Save csalgueiro/8665010 to your computer and use it in GitHub Desktop.
Calcular diferencia de dias en JS con datepicker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var start = $("#form_expedientes input[name='fecha']").datepicker('getDate'); | |
var end = $("#form_expedientes input[name='fecha_entrega']").datepicker('getDate'); | |
if(!start || !end) | |
return; | |
var days = 0; | |
if (start && end) { | |
days = Math.floor((end.getTime() - start.getTime()) / 86400000); // ms per day | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment