JSFiddle - React, Tailwind, and code Playground
by Rey Doe
JavaScript
var Dia = 24*60*60*1000;
// hoiras*minutos*segundos*milesimas
var Inicial = new Date(2017,02,12);
var Final = new Date(2017,02,22);
var Diferencia = Math.round(Math.abs((Inicial.getTime() - Final.getTime())/(Dia)));
alert(Diferencia);