Skip to content

subtractWorkingTime throws Error #46

@rejeevd

Description

@rejeevd

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());

Please use the below link to run the code
https://repl.it/@RejeevDivakaran/OpaqueUnfinishedModem#index.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions