javascript/script.js
//validation function to calculate day value
validation function to calculate day value
validation function to calculate day value
function calculateDayValue(){
  year = document.getElementById("year").value;
  CC = parseInt(year.substring(0,2));
  YY = parseInt(year.substring(2,4));
  MM = parseInt(document.getElementById("month").value);
  DD = parseInt(document.getElementById("date").value);
  d = ( ( (CC/4) -2*CC-1) + ( (5*YY/4) ) + ((26*(MM+1)/10) ) + DD)%7;
  console.log(d);
  return (Math.floor(d));
}
function calculateDayValue ( ) { year = document . getElementById ( "year" ) . value ; CC = parseInt ( year . substring ( 0 , 2 ) ) ; YY = parseInt ( year . substring ( 2 , 4 ) ) ; MM = parseInt ( document . getElementById ( "month" ) . value ) ; DD = parseInt ( document . getElementById ( "date" ) . value ) ; d = ( ( ( CC / 4 ) - 2 * CC - 1 ) + ( ( 5 * YY / 4 ) ) + ( ( 26 * ( MM + 1 ) / 10 ) ) + DD ) % 7 ; console . log ( d ) ; return ( Math . floor ( d ) ) ; }
validation function to calculate day value
validation function to calculate day value