{"size": 2499, "ext": "js", "max_stars_repo_path": "resources/assets/js/datepicker.js", "max_stars_repo_name": "danielcrblack/Kingdomhire", "max_stars_repo_stars_event_min_datetime": "2019-09-28T04:46:33.000Z", "max_stars_repo_stars_event_max_datetime": "2019-09-28T04:46:33.000Z", "max_issues_repo_path": "resources/assets/js/datepicker.js", "max_issues_repo_name": "danielcrblack/Kingdomhire", "max_issues_repo_issues_event_min_datetime": "2020-06-14T13:48:30.000Z", "max_issues_repo_issues_event_max_datetime": "2021-03-09T17:39:02.000Z", "max_forks_repo_path": "resources/assets/js/datepicker.js", "max_forks_repo_name": "dcrblack/Kingdomhire-2.0", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 32.4545454545, "max_line_length": 78, "alphanum_fraction": 0.4533813525}
$(document).ready(function () {
    // $('.dropdown-submenu a.submenu').on("click", function(e){
    //     $(this).next('ul').toggle();
    //     e.stopPropagation();
    //     e.preventDefault();
    // });

    if ($("#start_date").length) {
        $( "#start_date" ).datepicker({
            title: "Start Date",
            format: "yyyy-mm-dd",
            startDate: new Date(),
            autoclose: true,
            zIndexOffset: 1000,
            ignoreReadonly: true
        });

        $( "#end_date" ).click(function () {
            if ($( "#start_date" ).datepicker("getDate") === null) {
                $(this).attr("placeholder", "Fill in start date first...");
            }
        });

        if ($( "#start_date" ).datepicker("getDate") != null) {
            var date = $("#start_date").datepicker("getDate");
            date.setDate(date.getDate() + 1);
            $( "#end_date" ).datepicker({
                title: "End Date",
                format: "yyyy-mm-dd",
                startDate: date,
                autoclose: true,
                zIndexOffset: 1000,
                ignoreReadonly: true
            });
        }

        $("#start_date").on("changeDate", function(e) {
            $("#end_date").attr("placeholder", "End date...");
            $( "#end_date" ).datepicker("destroy");
            var date = $(this).datepicker("getDate");
            date.setDate(date.getDate() + 1);
            $( "#end_date" ).datepicker({
                title: "End Date",
                format: "yyyy-mm-dd",
                startDate: date,
                autoclose: true,
                zIndexOffset: 1000,
                ignoreReadonly: true
            });
            $( "#end_date" ).focus();
        });
    }

    if ($("#start_date_readonly").length) {
        var date = new Date($("#start_date_readonly").val())
        date.setDate(date.getDate() + 1);
        $( "#end_date" ).datepicker({
            title: "End Date",
            format: "yyyy-mm-dd",
            startDate: date,
            autoclose: true,
            zIndexOffset: 1000,
            ignoreReadonly: true
        });
    }

    $("#start_date_calender").click(function () {
        $( "#start_date" ).focus();
    });

    $("#end_date_calender").click(function () {
        $( "#end_date" ).focus();
        if ($( "#start_date" ).datepicker("getDate") === null) {
            $("#end_date").attr("placeholder", "Fill in start date first...");
        }
    });
});