I have the following code:
const thresholdDate = "2020-02-12";
const value = "2020-02-12T01:00+02:00";
const valueUtcOffset = moment.parseZone(value).utcOffset();
const thresholdDateWithOffset = moment.utc(thresholdDate).utcOffset(valueUtcOffset);
console.log(moment(value).isBefore(thresholdDateWithOffset))
const thresholdDate = "2020-02-12";
const value = "2020-02-12T01:00+02:00";
const valueUtcOffset = moment.parseZone(value).utcOffset();
const thresholdDateWithOffset = moment.utc(thresholdDate).utcOffset(valueUtcOffset);
console.log(moment(value).isBefore(thresholdDateWithOffset))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.min.js"></script>
The result of valueUtcOffset is 120.
However, the console.log() returns true and i don't understand why.
value with the UTC offset is 2020-02-11 11PM, whereas thresholdDateWithOffset should be 2020-02-11 10PM.
So how come it says that value is before thresholdDateWithOffset?