I need in JavaScript or TypeScript for Angular that the entered start date is not greater than 60 days for the entered end date... the logic would be: "maximum range 60 days" between the two inputs (dateFrom to dateTo). Hello, I need JS or Angular TS so that the entered start date is not greater than 60 days for the entered end date... the logic would be: "maximum range 60 days" for the inputs.
datepicker(){
var dateFrom = this.consultaForm.get('desdeCreacion').value;
var dateTo = this.consultaForm.get('hastaCreacion').value;
if(dateTo > (dateFrom < this.datePipe.transform(new Date(dateTo).getTime()-5100000000), 'yyyy-MM-dd')){
alert('Rango máximo 60 dias');
window.location.reload();}
}