[ad_1]
I have this code, in the `new Date(this.dataFormat + ‘T23:59’); I added T23:59 to get the time zone regardless of the person’s time zone, but it returns invalid date
`
const calendarDate = new Date(this.dataFormat + 'T23:59');
const today = new Date();
console.log(calendarDate) //Invalid Date
console.log(this.dataFormat) //Fri Jun 03 2022 20:59:59 GMT-0300 (Brasilia Standard Time)
if (calendarDate < today) {
this.errors.push('Data selecionada precisa ser maior que a atual.');
}
Could someone help me with how to work this part of the code?
maybe removing the ‘T23:59’ could be a solution, but with the different time zone it would fall into the error
[ad_2]