I have 2 dates, one start and one end, I try to avoid that the start is greater than the end, apart from that I can not do it, I get rare years, days that are not ... etc.
console.log("start ", m , d , y);
console.log("fin ", m2 , d2, y2);
console.log("-------");
console.log("start", new Date(m, d, y));
console.log("fin", new Date(m2, d2, y2));
if (new Date(m, d, y) > new Date(m2, d2, y2)) {
format = false;
this.errorServer = true;
this.message = "La fecha de inicio no puede ser mayor que la fecha de fin.";
}
And the result:
As a result of this change, I do not get the error that the start date is longer ...