$('.daycheck').each(function() {
                if (state['days'][i]) {
                    $(this).prop('checked', true);
                }
                i++;