{"size": 1209, "ext": "js", "max_stars_repo_path": "js/businesshelper.js", "max_stars_repo_name": "tolltech/Tolltrell", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/businesshelper.js", "max_issues_repo_name": "tolltech/Tolltrell", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/businesshelper.js", "max_forks_repo_name": "tolltech/Tolltrell", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.7857142857, "max_line_length": 64, "alphanum_fraction": 0.4772539289}
function GetDeltaDays(fromDate, toDate, withoutWeekend) {
    var acc = 0;
    var currentDate = new Date(fromDate);
    if (withoutWeekend) {
        while (true) {
            if (currentDate >= toDate) {
                return acc / (1000.0 * 60 * 60 * 24);
            }

            var prevDate = new Date(currentDate);
            //add 1 day
            currentDate.setDate(currentDate.getDate() + 1);
            if (currentDate > toDate) {
                currentDate = new Date(toDate);
            }

            if (IsWeekend(prevDate) && IsWeekend(currentDate)) {
                continue;
            }

            var startOfDay = new Date(currentDate);
            startOfDay.setHours(0, 0, 0, 0);
            if (IsWeekend(prevDate)) {
                acc += currentDate - startOfDay;
            }
            else if (IsWeekend(currentDate)) {
                acc += startOfDay - prevDate;
            }
            else {
                acc += currentDate - prevDate;
            }
        }
    }
    else {
        var delta = toDate - fromDate;
        return delta / (1000.0 * 60 * 60 * 24);
    }
}

function IsWeekend(date) {
    return date.getDay() == 0 || date.getDay() == 6;
}