I need to subtract two dates with the diff function of moment, the problem is that it does not recognize the diff function which sends me an error
var fechaActual = new Date();
debugger;
var Datos = traeIdEstado();
var FechaEstadoAnterior = Datos[0];
var idEstado = Datos[1];
var dateA = moment(fechaActual).format('YYYY-MM-DD');
var dateB = moment(FechaEstadoAnterior).format('YYYY-MM-DD');
var d = dateA.diff(dateB, 'days',true);
alert(d);