subtractWorkingTime from a nonworking time throws an error.
Please see the below code.
const moment = require("moment-business-time");
moment.locale("en", {
workinghours: {
0: null,
1: ["00:00:00", "24:00:00"],
2: ["00:00:00", "24:00:00"],
3: ["00:00:00", "24:00:00"],
4: ["00:00:00", "24:00:00"],
5: ["00:00:00", "24:00:00"],
6: null,
},
holidays: [],
});
var endDate = moment.utc("2020-12-26T15:00:00Z").add(3, "hours");
var startDate = endDate.subtractWorkingTime(1, "week");
console.log(startDate.format());
subtractWorkingTime from a nonworking time throws an error.
Please see the below code.
Please use the below link to run the code
https://repl.it/@RejeevDivakaran/OpaqueUnfinishedModem#index.js