DST transition does not work correctly.
Set up the local Europe/Amsterdam time zone on your device.
Code:
import moment from "moment";
import "moment-business-time";
moment.updateLocale("nl", {
workinghours: {
0: ["00:00:00", "10:00:00"],
1: ["00:00:00", "10:00:00"],
2: ["00:00:00", "10:00:00"],
3: ["00:00:00", "10:00:00"],
4: ["00:00:00", "10:00:00"],
5: ["00:00:00", "10:00:00"],
6: ["00:00:00", "10:00:00"]
}
});
const dstTime = new Date("2022-10-30 02:00:00 UTC+0200");
const dstTimeThen = moment(+dstTime)
.addWorkingTime(1, "hour")
.toDate(); // also "2022-10-30 02:00:00 UTC+0200", but should be "2022-10-30 02:00:00 UTC+0100"
console.log("is equal:", dstTime.valueOf() === dstTimeThen.valueOf()); // true
DST transition does not work correctly.
Set up the local Europe/Amsterdam time zone on your device.
Code: