YaleSTC/shifts

View on GitHub
app/assets/javascripts/department_config.js

Summary

Maintainability
A
2 hrs
Test Coverage
jQuery(document).ready(function(){
    checkLastDay();
    $("#department_config_monthly").change(function(){
        checkLastDay();
    });
});

function checkLastDay(){
  if ($("#department_config_monthly option:selected").text() == "Weekly") {
            $("#month").hide();
            $("#month :option").attr("disabled", "disabled");
            $("#week :option").removeAttr("disabled");
            $("#week").show();
        } else {
            $("#week").hide();
            $("#week :option").attr("disabled", "disabled");
            $("#month :option").removeAttr("disabled");
            $("#month").show();
        }
}