When I try this it produces NaN
const date1 = new Date('29/11/2021');
const date2 = new Date('30/11/2021');
const diffTime = Math.abs(date2 - date1);
but this works
const date1 = new Date('7/13/2010');
const date2 = new Date('12/15/2010');
const diffTime = Math.abs(date2 - date1);
Could someone please explain why?
I got the code from this question but when I tried it with my dates it didn't work