SoFunction
Updated on 2025-03-10

javascript code for input date selection function

9999) {alert("The year value is not between 1000 and 9999!");return;} var n = m - 10; if (n 9999) n = 9974; var s = ""; =""; = selectInnerHTML; (); } function tmpSelectMonthInnerHTML(strMonth) // pull-down box for month { if ((/\D/)!=null){alert("The input parameter for month is not a number!");return;} var m = (strMonth) ? strMonth : new Date().getMonth() + 1; var s = ""; =""; = selectInnerHTML; (); }  function closeLayer() // Close of this layer { ="none"; }  function () { if (==27)="none"; }  function IsPinYear(year) //Judge whether it is a leap year { if (0==year%4&&((year%100!=0)||(year%400==0))) return true;else return false; }  function GetMonthCount(year,month) // February of the leap year is 29 days { var c=MonHead[month-1];if((month==2)&&IsPinYear(year)) c++;return c; } function GetDOW(day,month,year) //Find the day of the week of a certain day { var dt=new Date(year,month-1,day).getDay()/7; return dt; } function meizzPrevY() //Flip forward Year { if(meizzTheYear > 999 && meizzTheYear 999 && meizzTheYear 1){meizzTheMonth--}else{meizzTheYear--;meizzTheMonth=12;} meizzSetDay(meizzTheYear,meizzTheMonth); } function meizzNextM() //Follow the month back { if(meizzTheMonth==12){meizzTheYear++;meizzTheMonth=1}else{meizzTheMonth++} meizzSetDay(meizzTheYear,meizzTheMonth); } function meizzSetDay(yy,mm) //Main writing program*************** { meizzWriteHead(yy,mm); for (var i = 0; i " + meizzWDay[i] + ""; = (yy == new Date().getFullYear() && mm == new Date().getMonth()+1 && meizzWDay[i] == new Date().getDate()) ? "#FFD700" : "#ADD8E6"; ="hand" } else{="";="";="default"} } } function meizzDayClick(n) //Click the display box to select the date, the main input function **************** { var yy = meizzTheYear; var mm = meizzTheMonth; if (mm
[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]