lennym/moment-business-time

Problem with addWorkingTime(hour, 'hours'), crash browser IE 11/Edge

peterhe2000 opened this issue · 3 comments

Seems issue happening with this function in the libraray

function addOrSubtractMethod(fn) {
    return function (num, unit) {
        if (typeof unit !== 'string') {
            throw new Error('unit must be defined');
        }
        if (typeof num !== 'number') {
            throw new Error('duration must be defined');
        }
        var args = [].slice.call(arguments);
        if (args.length % 2) {
            throw new Error('moment#(add/subtract)WorkingTime requires an even number of arguments');
        }

        var d = this;

        while (args.length >= 2) {
            d = fn.bind(null, d).apply(null, args.slice(-2));
            args = args.slice(0, -2);
        }

        return copy(d, this);
    };
}

Debug via edge seems freeze at line d = fn.bind(null, d).apply(null, args.slice(-2));. any ideas?

It has been a month. May i know any update for this issue?

I haven't looked at it at all to be quite honest.

If you can provide the following information then that would be useful:

  • What version of this module are you using?
  • How are you compiling it for use in the browser? (e.g. browserify, webpack etc)
  • Can you reproduce the error in any other browsers?
  • Do you have a small, reproducible test case for the issue?
  • Have you taken any steps to debug the issue yourself?

Thanks.

Sry. It's not your library's issue.
It's an issue from Angular 2 datePipe service angular/angular#9524.
Thanks for getting back to me.