js/script.js
//This function calculates the day of the week.
This function calculates the day of the week.
This function calculates the day of the week .
function findBirthday(day, month, year, gender){
    var days = ["Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"];
    var day = parseInt(day, 10); 
    var month = parseInt(month, 10); 
    var monthCopy = parseInt(month,10); 
    var year = parseInt(year,10);
    if (month == 1) {
       monthCopy = 13;
       year = year-1;
    }
    if (month == 2) {
       monthCopy = 14;
       year = year-1;
    }
    var val1 = parseInt(((monthCopy+1)*3)/5, 10);
    var val2 = parseInt(year/4, 10);
    var val3 = parseInt(year/100, 10);
    var val4 = parseInt(year/400, 10);
    var val5 = day+(monthCopy*2)+val1+year+val2-val3+val4+2;
    var val6 = parseInt(val5/7, 10);
    var val0 = val5-(val6*7);
    var siku = days[val0];
    displayDay(gender, siku);
}
function findBirthday ( day , month , year , gender ) { var days = [ "Saturday" , "Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" ] ; var day = parseInt ( day , 10 ) ; var month = parseInt ( month , 10 ) ; var monthCopy = parseInt ( month , 10 ) ; var year = parseInt ( year , 10 ) ; if ( month == 1 ) { monthCopy = 13 ; year = year - 1 ; } if ( month == 2 ) { monthCopy = 14 ; year = year - 1 ; } var val1 = parseInt ( ( ( monthCopy + 1 ) * 3 ) / 5 , 10 ) ; var val2 = parseInt ( year / 4 , 10 ) ; var val3 = parseInt ( year / 100 , 10 ) ; var val4 = parseInt ( year / 400 , 10 ) ; var val5 = day + ( monthCopy * 2 ) + val1 + year + val2 - val3 + val4 + 2 ; var val6 = parseInt ( val5 / 7 , 10 ) ; var val0 = val5 - ( val6 * 7 ) ; var siku = days [ val0 ] ; displayDay ( gender , siku ) ; }
This function calculates the day of the week.
This function calculates the day of the week .
//Day of the month. //Month of the year. //Year