         variables = window.location.href.split("/");

            year = variables[(variables.length - 4)];
            month = variables[variables.length - 3] - 1;
            day = variables[variables.length - 2];

            link = '/attendance/';

            date = new Date(year, month, day, 0, 0, 0);
            date.setDate(date.getDate() + i);
            link += date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate();

            window.location = link;
        }
    </script>

 