public sheet: https://docs.google.com/spreadsheets/d/1pXrUkA-fY1hw3bie4Bv1mamkmzics9dfX59B12spuPI/edit?usp=sharing
Issue: I have two dates that look equivalent but apps script is saying they aren't. I have a sheet with dates. I cycle through the dates to see if one date is equivalent to the previous date. The script (starting on the second row) should return true, false, true. But instead it returns false, false, false. Any thoughts about why this happens this way?
9/8/2020
9/8/2020 // should be true, returns false
9/15/2020 // should be false, ok
9/15/2020 // should be true, returns false
Code snippets
//test code
for (var r=10;r<=14;r++){
for (var c=2;c<=4;c++){
Logger.log(sh.getRange(r,c).getValue());
Logger.log(sh.getRange(r-1,c).getValue());
Logger.log(sh.getRange(r,c).getValue() == sh.getRange(r-1,c).getValue());
}}
Logger response (shows dates are objects but equivalent dates aren't...):
[20-10-25 17:05:30:975 EDT] Tue Sep 08 00:00:00 GMT-04:00 2020
[20-10-25 17:05:30:976 EDT] object
[20-10-25 17:05:30:977 EDT] Tue Sep 15 00:00:00 GMT-04:00 2020
[20-10-25 17:05:30:979 EDT] object
[20-10-25 17:05:30:980 EDT] false
[20-10-25 17:05:30:981 EDT] false
[20-10-25 17:05:30:982 EDT] Tue Sep 15 00:00:00 GMT-04:00 2020
[20-10-25 17:05:30:984 EDT] object
[20-10-25 17:05:30:986 EDT] Tue Sep 15 00:00:00 GMT-04:00 2020
[20-10-25 17:05:30:987 EDT] object
[20-10-25 17:05:30:989 EDT] false
[20-10-25 17:05:30:990 EDT] false