精华内容
下载资源
问答
  • html日期控件

    2018-03-19 15:41:14
    html日期控件html日期控件html日期控件html日期控件
  • Html日期控件

    2020-07-08 09:43:00
    HTML5新控件 - 日期和时间选择输入: 参考链接:https://blog.csdn.net/lianzhang861/article/details/80422513 几款实用的前端日历时间日期选择控件: 参考链接:...
    展开全文
  • HTML 日期控件

    2020-01-06 20:50:34
    日期选择器:<input type=”date”/> 周选择器:<input type=”week”/> 月份选择器:<input type=”month”/> 时间选择器:<input type=”time”/> 日期时间选择器:<input...

    日期选择器:<input type=”date”/>

     

    周选择器:<input type=”week”/>

     

    月份选择器:<input type=”month”/>

     

    时间选择器:<input type=”time”/>

     

    日期时间选择器:<input type=”datetime”/>

     

    本地日期时间选择器:<input type=”datetime-local”/>

    展开全文
  • HTML日期控件

    2020-01-08 14:02:39
    年/月/日<input type=”date”/> –年--周<input type=”week”/> –年--月<input type=”month”/> – :–(时间)<input type=”time”/>...本地日期时间<input type=”da...
    1. 年/月/日<input type=”date”/>
    2. –年--周<input type=”week”/>
    3. –年--月<input type=”month”/>
    4. – :–(时间)<input type=”time”/>
    5. 年/月/日 --:-- <input type=”datetime”/>
    6. 本地日期时间<input type=”datetime-local”/>
      以上方法不适用于火狐浏览器.
    展开全文
  • html日期控件

    千次阅读 2007-08-24 16:13:00
    把以下4个文件放到同一个文件夹下,运行 test.html 即可 //文件 DateBox.html hiyu var getStr=window.dialogArguments; 

    把以下4个文件放到同一个文件夹下,运行 test.html 即可

    //文件 DateBox.html  

    <!-- 
    <html> 
    <head> 
    <title>hiyu</title> 
    <LINK href="./tenkey.css" type=text/css rel=stylesheet> 
    <meta http-equiv="Content-Language" content="ja"> 
    <meta http-equiv="Content-Type" content="text/html; charset=shift_jis"> 
    <meta http-equiv="Expires" content="-10"> 
    <meta http-equiv="Pragma" content="No-cache"> 
    <meta http-equiv="Cache-Control", "private"> 
    </head> 
    <SCRIPT language=javascript> 
             var getStr=window.dialogArguments;   
    </script> 
    <body onLoad=" Initform();document.frmMain.btnCancel.focus();" onContextmenu="return false;"> 
    <form id="frmMain" name="frmCld"> 
             <TABLE id="tblHead" class="TrW" border="0" cellspacing="0" cellpadding="2" bgcolor="#ffffff" style="margin-top:8px;"> 
                       <TR > 
                                <TD width="30%" height="35" align="left" style="padding-top:12px;"> 
                                         <SELECT style="font-size:32px; width:75%; height:100%;" id="selYaer" name="selYaer" onChange="InitCalendar(this.value,window.document.frmMain.selMon.value,0)"> 
                                         </SELECT> 
                                </TD> 
                                <TD width="40%" align="center"> 
                                         <INPUT class="BtnSetToday1" οnclick="SetToday()" type="button" value="本日を選択" ID="btnToday" NAME="btnToday"> 
                                </TD> 
                                <TD width="30%" align="right" style="padding-top:12px;" > 
                                         <SELECT style="font-size:32px; width:75%; height:100%;" id="selMon" name="selMon" onChange="InitCalendar(window.document.frmMain.selYaer.value,this.value,0)"> 
                                                   <OPTION value="1">1月</OPTION> 
                                                   <OPTION value="2">2月</OPTION> 
                                                   <OPTION value="3">3月</OPTION> 
                                                   <OPTION value="4">4月</OPTION> 
                                                   <OPTION value="5">5月</OPTION> 
                                                   <OPTION value="6">6月</OPTION> 
                                                   <OPTION value="7">7月</OPTION> 
                                                   <OPTION value="8">8月</OPTION> 
                                                   <OPTION value="9">9月</OPTION> 
                                                   <OPTION value="10">10月</OPTION> 
                                                   <OPTION value="11">11月</OPTION> 
                                                   <OPTION value="12">12月</OPTION> 
                                         </SELECT> 
                                </TD> 
                       </TR> 
             </TABLE>  
             <Table class="TrW" border="0" cellspacing="0" cellpadding="2" bgcolor="#FFFFFF" style="margin-top:5px;"> 
             <TR><TD ALIGN=left valign=top> 
             <TABLE width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFCC"> 
                       <TR><TD valign="top" bgcolor="#808080" ALIGN="center"> 
                                <TABLE width="100%" id="tblCal" border="0" cellspacing="1" cellpadding="0"> 
                                         <tr class="TrH"> 
                                                   <td align="center" class="Sunday">日</td> 
                                                   <td align="center" class="Weektitle">一</td> 
                                                   <td align="center" class="Weektitle">二</td> 
                                                   <td align="center" class="Weektitle">三</td> 
                                                   <td align="center" class="Weektitle">四</td> 
                                                   <td align="center" class="Weektitle">五</td> 
                                                  <td align="center" class="Saturday">六</td> 
                                         </tr> 
                                         <tr class="TrH"> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');" onMouseOut="SetBackColorByMouseOut(this);"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"> 
                                                   </td> 
                                         </tr> 
                                         <tr class="TrH"> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');" onMouseOut="SetBackColorByMouseOut(this);"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                         </tr> 
                                         <tr class="TrH"> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');" onMouseOut="SetBackColorByMouseOut(this);"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                         </tr> 
                                         <tr class="TrH"> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');" onMouseOut="SetBackColorByMouseOut(this);"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                         </tr> 
                                         <tr class="TrH"> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');" onMouseOut="SetBackColorByMouseOut(this);"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                         </tr> 
                                         <tr class="TrH"> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');" onMouseOut="SetBackColorByMouseOut(this);"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                                   <td align="center" class="CalendarCell" onClick="SetDate(this)" onMouseOut="SetBackColorByMouseOut(this);" 
                                                            οnmοuseοver="SetBackColorByMouseOver(this,'#FFFF80');"></td> 
                                         </tr> 
                                </TABLE> 
                                </TD></TR> 
             </TABLE> 
             </TD></TR> 
    </TABLE> 
    <TABLE cellSpacing="0" cellPadding="2" width="100%" bgColor="#ffffff" border="0" style="margin-top:5px; font-size:32px;"> 
             <TR height="58"> 
                       <TD width="35%" align="left"> 
                                <INPUT class="BtnChgCalendar1" type="button" value="前年" align="right" onClick="ChangeCalendar(0,1)">&nbsp; 
                                <INPUT class="BtnChgCalendar1" type="button" align="right" value="前月" onClick="ChangeCalendar(1,1)"> 
                       </TD> 
                       <TD width="30%" align="center"> 
                                <INPUT name="btnCancel" class="BtnCalendarCancel1" οnclick="CloseWindow();" type="button" value="CLOSE"> 
                       </TD> 
                       <TD width="35%" align="right"> 
                                <INPUT class="BtnChgCalendar1" type="button" value="翌月" onClick="ChangeCalendar(1,0)">&nbsp; 
                                <INPUT class="BtnChgCalendar1" type="button" align="right" value="翌年" onClick="ChangeCalendar(0,0)"> 
                       </TD> 
             </TR> 
    </TABLE> 
    </form> 
    </body> 
    </html> 
    <Script Language="javascript1.2"> 
     
    function Initform() { 
             var initDate = getStr[0]; 
             if (initDate == "") { 
                       InitCalendar(0, 0, 0); 
             } else { 
                       initDate = new Date(initDate); 
                       InitCalendar(initDate.getFullYear(), initDate.getMonth() + 1, initDate.getDate()); 
             } 

    //************************************** 
     
    // カレンダーを初期化 
    //************************************** 
    function InitCalendar(p_Year,p_Mon,p_Day) { 
        InitYearSel(p_Year); 
        InitMonSel(p_Mon); 
        InitDay(window.document.frmMain.selYaer.value,window.document.frmMain.selMon.value,p_Day); 

    //************************************** 
     
    // 日付を変わり 
    // p_Mode:0 年   1 月 
    // p_Plus:0 +   1 - 
    //************************************** 
    function ChangeCalendar(p_Mode,p_Plus) { 
             if(0==p_Mode) { //年 
                       if(0==p_Plus) { 
                                InitCalendar((window.document.frmMain.selYaer.value-(-1)),window.document.frmMain.selMon.value,0); 
                       } else if(1==p_Plus) { 
                                InitCalendar((window.document.frmMain.selYaer.value-1),window.document.frmMain.selMon.value,0) 
                       } 
             } else if(1==p_Mode) { //月 
                       if(0==p_Plus) { 
                                if(12==window.document.frmMain.selMon.value) { 
                                         InitCalendar((window.document.frmMain.selYaer.value-(-1)),1,0); 
                                } else { 
                                    InitCalendar(window.document.frmMain.selYaer.value,(window.document.frmMain.selMon.value-(-1)),0); 
                                } 
                       } else if(1==p_Plus) { 
                                if(1==window.document.frmMain.selMon.value) { 
                                         InitCalendar((window.document.frmMain.selYaer.value-1),12,0) 
                                } else { 
                                         InitCalendar(window.document.frmMain.selYaer.value,(window.document.frmMain.selMon.value-1),0); 
                                } 
                       } 
             } 

    //************************************** 
     
    // 年部分初期化 
    //************************************** 
    function InitYearSel(p_Year) { 
             if(0==p_Year) { 
                       var d = new Date(); 
                       p_Year = d.getYear(); 
             } 
             //Select中に年数を追加 
             //先ずクリア 
             var selLen = window.document.frmMain.selYaer.options.length; 
             for(j=0;j<selLen;j++) { 
                window.document.frmMain.selYaer.options.remove(selLen-(j+1)); 
             } 
             var arrYear = new Array(); 
             for (i = -5; i<6; i++) { 
           var oOption = document.createElement("OPTION"); 
                window.document.frmMain.selYaer.options.add(oOption); 
                oOption.innerText = p_Year - (-i); 
                oOption.value = p_Year - (-i); 
              } 
      //年を選択する 
             window.document.frmMain.selYaer.value = p_Year; 

    //************************************** 
     
    // 月部分初期化 
    //************************************** 
    function InitMonSel(p_Mon) { 
             if(0==p_Mon) { 
                 var d = new Date(); 
                       p_Mon = d.getMonth() + 1; //0 <= getMonth <= 11 
             } 
             //月を選択する 
             window.document.frmMain.selMon.value = p_Mon; 

    //************************************** 
     
    // 日付部分初期化 
    //************************************** 
    function InitDay(p_Year,p_Mon,p_Day) { 
             if(0==p_Day) { 
                 var now = new Date(); 
                       p_Day = now.getDate(); 
             } 
             var indexDay = GetFirstDayIndexInWeek(p_Year,p_Mon);   //0-6 
             var allDays = GetDaysInMonth(p_Year,p_Mon); 
             //前の月 
             var preDay = AddMonth(p_Year,p_Mon,-1); 
             var prealldays = GetDaysInMonth(preDay.substring(0,4),preDay.substring(4,(preDay.length-4))); 
             //今日の日 
             var now = new Date(); 
             var nowDay = now.getDate(); 
             var blnEque = IsSameYearMon(p_Year,p_Mon);   //今操作の日付はシステムの年と月は同じですか 
             //rows=7 cols=7 
             //先ずTable部分をクリア 
             for (i=1; i<7; i++) { //i=0 is title 
             for (j=0; j<7; j++) { 
                       document.all.tblCal.rows(i).cells(j).innerText=""; 
                                document.all.tblCal.rows(i).cells(j).style.backgroundColor = "#FFFFCC"; 
             } 
        } 
             for (i=1; i<7; i++) { //i=0 is title 
             for (j=0; j<7; j++) { 
                                if(((i-1)*7 + j) < indexDay) { 
                    //前の月 
                                         //document.all.tblCal.rows(i).cells(j).innerText = prealldays - (indexDay- ((i-1)*7 + j)); 
                                } else { 
                                         var strDayTmp = (((i-1)*7 + j)-indexDay) + 1 
                                         if(strDayTmp <= allDays) { //Current Day <= All Days 
                                                   document.all.tblCal.rows(i).cells(j).innerText = strDayTmp; 
                                                   if (p_Day == 0) { 
                                                            if((blnEque==1) && (nowDay==strDayTmp)) { 
                                                                      document.all.tblCal.rows(i).cells(j).style.backgroundColor = "#FFEE00"; 
                                                            } 
                                                   } else { 
                                                            if((blnEque==1) && (p_Day==strDayTmp)) { 
                                                               document.all.tblCal.rows(i).cells(j).style.backgroundColor = "#FFEE00"; 
                                                            } else if ((blnEque==2) && (p_Day==strDayTmp)) { 
                                                                     document.all.tblCal.rows(i).cells(j).style.backgroundColor = "#FFEE00"; 
                                                            } 
                                                   } 
                                         } else { //次の月 
                      // 
                                         } 
                                } 
                       } 
             } 

     
    //************************************** 
     
    // IsSameYearMon 
    //************************************** 
    function IsSameYearMon(p_Year,p_Mon) { 
             var blnRet=0; 
             var now = new Date(); 
             if((p_Year==now.getYear()) && (p_Mon==(now.getMonth() + 1))) { 
                       blnRet = 1; 
             } else { 
                       blnRet = 2; 
             } 
             return blnRet; 

    //************************************** 
     
    // AddMonth 
    //************************************** 
    function AddMonth(p_Year,p_Mon,p_Plus) { 
        p_Mon = p_Mon + p_Plus; 
       var years = p_Plus/12; 
        if(years == 0) { 
                       years =years + 1; 
        } 
             if(p_Mon > 12) { 
                       p_Mon = p_Mon -12; 
                       p_Year = p_Year + years 
             } else if (p_Mon <= 0) { 
                       p_Mon = p_Mon +12; 
                       p_Year = p_Year - years; 
             } 
             return (p_Year.toString() + p_Mon.toString()); 

    //************************************** 
     
    // IsLeapYear 
    //************************************** 
    function IseapYear(p_year) { 
     if (((p_year % 4)==0) && ((p_year % 100)!=0) || ((p_year % 400)==0)) { 
             return (1); 
     } else { 
        return (0); 
     } 

    //************************************** 
     
    // GetDaysInMonth 
    //************************************** 
    function GetDaysInMonth(p_year,p_Mon) { 
       var days; 
       if (p_Mon==1 || p_Mon==3 || p_Mon==5 || p_Mon==7 || p_Mon==8 || p_Mon==10 || p_Mon==12) { 
           days = 31; 
       } else if(p_Mon==4 || p_Mon==6 || p_Mon==9 || p_Mon==11) { 
                 days = 30; 
       } else if(p_Mon==2) { 
          if(IseapYear(p_year)==1) { 
           days = 29; 
          } else { 
           days = 28; 
          } 
       } 
       return days; 

    //************************************** 
     
    // OnMouseOut BackColorをセット 
    //************************************** 
    function SetBackColorByMouseOut(p_obj) { 
             var blnRet = IsSameYearMon(window.document.frmMain.selYaer.value,window.document.frmMain.selMon.value); 
             var now = new Date(); 
             if(blnRet==1 && p_obj.innerText==now.getDate()) { 
                p_obj.style.backgroundColor="#FFEE00"; 
        } else {                
                       p_obj.style.backgroundColor="#FFFFCC";                  
             } 

    //************************************** 
     
    // OnMouseOver BackColorをセット 
    //************************************** 
    function SetBackColorByMouseOver(p_obj,p_Color) { 
             if(p_obj.innerText != "") { 
                       p_obj.style.backgroundColor=p_Color; 
             } 

    //************************************** 
     
    // GetFirstDayIndexInWeek 
    // 0:日 1:月 2:火 3:水 4:木 5:金 6:土 
    //************************************** 
    function GetFirstDayIndexInWeek(p_Year,p_Mon) { 
        return GetDayOfWeek(p_Year,p_Mon,1); 

    /************************************** 
     
    /
    // GetDayOfWeek 
    // 0:日 1:月 2:火 3:水 4:木 5:金 6:土 
    //************************************** 
    function GetDayOfWeek(p_Year,p_Mon,p_Day){ 
             var d = new Date(p_Year,(p_Mon-1),p_Day); //p_Mon is from 0-11 
        return d.getDay(); 

    //************************************** 
     
    // GetYobi 
    // 0:日 1:月 2:火 3:水 4:木 5:金 6:土 
    //************************************** 
    function GetYobi(p_WeekIndex){ 
             var rtn; 
             switch (p_WeekIndex){ 
                       case 0: rtn = "日"; break; 
                       case 1: rtn = "一"; break; 
                       case 2: rtn = "二"; break; 
                      case 3: rtn = "三"; break; 
                       case 4: rtn = "四"; break; 
                       case 5: rtn = "五"; break; 
                       case 6: rtn = "六"; break; 
             } 
             return rtn; 

    //************************************** 
     
    // SetDate 
    // 親画面に日付を戻る    yyyy-mm-dd 
    //************************************** 
    function SetDate(p_obj) { 
             var strYear = window.document.frmMain.selYaer.value; 
             var strMon = window.document.frmMain.selMon.value; 
             var strDay = p_obj.innerText; 
             if(strDay != ""){ 
                       var iWeek = GetDayOfWeek(strYear,strMon,strDay); 
                       var strYobi = GetYobi(iWeek); 
                       if(strMon < 10){//2桁になる 
                                strMon = "0" + strMon; 
                       } 
                       if(strDay < 10){ 
                                strDay = "0" + strDay; 
                       } 
                       window.returnValue = strYear + "-" + strMon + "-" + strDay; 
                       self.close(); 
             } 

    //************************************** 
     
    // SetDate 
    // 親画面に日付を戻る    yyyy-mm-dd 
    //************************************** 
    function SetToday() { 
        var d = new Date(); 
             var strYear = d.getYear(); 
             var strMon = d.getMonth() + 1; 
             var strDay = d.getDate(); 
             var iWeek = GetDayOfWeek(strYear,strMon,strDay); 
             var strYobi = GetYobi(iWeek);        
             if(strMon < 10){//2桁になる 
                       strMon = "0" + strMon; 
             } 
             if(strDay < 10){ 
                       strDay = "0" + strDay; 
             } 
             window.returnValue = strYear + "-" + strMon + "-" + strDay; 
             self.close(); 

    //************************************** 
     
    // CloseWindow 
    // 親画面にNULLを戻る,画面を閉じる 
    //************************************** 
    function CloseWindow() { 
             //window.returnValue = ""; 
             self.close(); 

    </Script> 

     

     

    //文件 tenkey.css

    TABLE { 

             BORDER-LEFT-COLOR
    : #000000; BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-COLOR: #000000; BORDER-COLLAPSE: collapse; BORDER-RIGHT-COLOR:
     #000000 

    }
     

    TD 
    { 

             FONT-SIZE
    : 11pt; BORDER-LEFT-COLOR: #d7d7d7; BORDER-BOTTOM-COLOR: #d7d7d7; COLOR: black; BORDER-TOP-COLOR: #d7d7d7; BORDER-RIGHT-COLOR:
     #d7d7d7 

    }
     

    .TDBorder 
    { 

             FONT-SIZE
    : 11pt; BORDER-LEFT-COLOR: #000000; BORDER-BOTTOM-COLOR: #000000; COLOR: black; BORDER-TOP-COLOR: #000000; BORDER-RIGHT-COLOR:
     #000000 

    }
     

    .Main 
    { 

             OVERFLOW
    : auto; align:
     center 

    }
     

    .BodyStyle 
    { 

             MARGIN
    : 0px; align:
     center 

    }
     

    .Header 
    { 

             FONT-SIZE
    : 11pt; COLOR: #ffffff; BACKGROUND-COLOR:
     #ff9933 

    }
     

    .HeadertitleC 
    { 

             FONT-SIZE
    : 17pt; BACKGROUND-IMAGE: url(); COLOR: #ffffff; BACKGROUND-COLOR:
     #ff9933 

    }
     

    .HeadertitleL 
    { 

             FONT-SIZE
    : 11pt; BACKGROUND-IMAGE: url(); WIDTH: 7px; COLOR: #ffffff; BACKGROUND-COLOR:
     #ff9933 

    }
     

    .HeadertitleR 
    { 

             FONT-SIZE
    : 11pt; BACKGROUND-IMAGE: url(); WIDTH: 7px; COLOR: #ffffff; BACKGROUND-COLOR:
     #ff9933 

    }
     

    .HeaderNavi 
    { 

             FONT-SIZE
    : 11pt; BACKGROUND-IMAGE: url(); COLOR: #ffffff; BACKGROUND-COLOR:
     #cc3333 

    }
     

    .HeaderNaviLink 
    { 

             COLOR
    :
     #ffff66 

    }
     

    .FooterBG 
    { 

             FONT-SIZE
    : 9pt; BACKGROUND-IMAGE: url); COLOR: #000000; BACKGROUND-COLOR:
     #ff9933 

    }
     

    .Footer 
    { 

             HEIGHT
    : 50px; BACKGROUND-COLOR:
     #ff6699 

    }
     

    .TableBorder 
    { 

             BORDER-RIGHT
    : gray 2px solid; BORDER-TOP: gray 2px solid; BORDER-LEFT: gray 2px solid; BORDER-BOTTOM:
     gray 2px solid 

    }
     

    .TokyoFoodButtonRegist 
    { 

             PADDING-RIGHT
    : 0px; BACKGROUND-POSITION: 15% 50%; FONT-WEIGHT: bold; FONT-SIZE: 15px; BACKGROUND-IMAGE: url(); VERTICAL-ALIGN: middle; WIDTH: 110px; COLOR: #ff0000; BACKGROUND-REPEAT: no-repeat; HEIGHT: 40px; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN:
     center 


    }
     

    .TokyoFoodButtonMenuBack 
    { 

             PADDING-RIGHT
    : 10px; BACKGROUND-POSITION: 15% 50%; FONT-WEIGHT: bold; FONT-SIZE: 15px; BACKGROUND-IMAGE: url(); VERTICAL-ALIGN: middle; WIDTH: 110px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 40px; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN:
     right 

    }
     

    .TokyoFoodButtonPrint 
    { 

             PADDING-RIGHT
    : 0px; BACKGROUND-POSITION: 15% 50%; FONT-WEIGHT: bold; FONT-SIZE: 15px; BACKGROUND-IMAGE: url(); VERTICAL-ALIGN: middle; WIDTH: 110px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 40px; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN:
     center 

    }
     

    .TokyoFoodButtonBack 
    { 

             PADDING-RIGHT
    : 0px; BACKGROUND-POSITION: 15% 50%; FONT-WEIGHT: bold; FONT-SIZE: 15px; BACKGROUND-IMAGE: url(); VERTICAL-ALIGN: middle; WIDTH: 110px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 40px; BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN:
     center 

    }
     

    .CellControlBox 
    { 

             FONT-SIZE
    : 12pt; BACKGROUND-IMAGE: url(); BACKGROUND-COLOR:
     #ff9933 

    }
     

    .CalcNTd 
    { 

             BACKGROUND-POSITION
    : center; VERTICAL-ALIGN: middle; BACKGROUND-REPEAT: no-repeat; TEXT-ALIGN:
     center 

    }
     

    .BtnChgCalendar1
    { 

             font-size
    :32px;
     

             width
    :40%;
     

             border
    :2px solid #999999;
     

             background
    :#F4C062;
     

             color
    :#000000;
     

    }
     

    .BtnSetToday1
    { 

             font-size
    :32px;
     

             width
    :75%;
     

             border
    :2px solid #999999;
     

             background
    :#F4C062;
     

             color
    :#ff0000;
     

    }
     

    .BtnCalendarCancel1
    { 

             font-size
    :32px;
     

             width
    :80%;
     

             border
    :2px solid #999999;
     

             background
    :#F4C062;
     

             color
    :#0000ff;
     

    }
     

    .Sunday
    { 

             background-color
    :#FF0000;
     

             color
    :#FFFFFF;
     

             font-weight
    :bold;
     

             font-size
    :32px;
     

    }
     

    .Saturday
    { 

     
             background
    :#0000FF;
     

             color
    :#FFFFFF;
     

             font-weight
    :bold;
     

             font-size
    :32px;
     

    }
     

    .Weektitle
    { 

     
             background
    :#FFFF99;
     

             font-weight
    :bold;
     

             font-size
    :32px;
     

    }
     

    .BtnChgCalendar
    { 

     
             font-size
    :32px;
     

             width
    :40%;
     

             border
    :1px solid #CC3333;
     

             background
    :#FF9933;
     

             color
    :#FFFFFF;
     

    }
     

    .BtnCalendarCancel
    { 

     
             font-size
    :32px;
     

             width
    :70%;
     

             border
    :1px solid #666666;
     

             background
    :#CC3333;
     

             color
    :#FFFFFF;
     

    }
     

    .TrSide 
    { 

             width
    :564;
     

             height
    :52;
     

    }
     

    .TrH 
    { 

             height
    :52;
     

    }
     

    .TrW 
    { 

             width
    :564;
     

    }
     

    .BtnSetToday
    { 

             font-size
    :32px;
     

             width
    :60%;
     

             border
    :1px solid #CC3333;
     

             background
    :#FF9933;
     

             color
    :#FFFFFF;
     

    }
     

    .CalendarCell
    { 

     
             font-weight
    :bold;
     

             font-size
    :32px;
     

    }
     

     

    //文件 tenkey.js  

    var url=""


    /*

     * 

    *textId 

    *setDate 

    *nowSet:aways==setDate 



    *
    */
     

    function setDate(setDate,textId)


                       
    if(setDate)


                       }
    else


                                
    if(textId)


                                         
    if((document.getElementById(textId).value).length>0)


                                                   setDate
    =
    document.getElementById(textId).value; 

                                         }
    else

                                                   setDate
    =new
     Date(); 

                                         }
     

                                }
    else

                                         setDate
    =new
     Date(); 

                                }
     

                       }
     

             setDate
    =
    getDateType(setDate);                                              

             
    return
     showDateBox(setDate) 

    }
     


    function showDateBox(setDate)


             
    var mxh1 = new Array(setDate,""
    ); 

             
    var mstr=window.showModalDialog(url+"DateBox.html" + "?temp=" + new Date(), mxh1,"dialogWidth: 570px;dialogHeight: 550px;help: no;status: no;unadorne: yes;scroll: no "
    );                              

             
    if(mstr!=null


                       
    return
     mstr; 

    }
     


     
    function getDateType(strValue) 


             
    if(strValue.length>0)


                       
    var r = strValue.match(/^(d{1,4})(-|/)(d{1,2})2(d{1,2})$/
    ); 

                       
    if(r==null


                                strValue
    =new
     Date(); 

                       }
    else

                                strValue 
    = new Date(r[1], r[3]-1,r[4
    ]); 

                       }
     

             }
            

             
    var dCurMonth =String(strValue.getMonth()+1).length==1?("0"+String(strValue.getMonth()+1)):String(strValue.getMonth()+1
    ); 

             
    var dCurDayOfMonth = String(strValue.getDate()).length==1?("0"+
    String(strValue.getDate())):String(strValue.getDate()); 

             
    var dCurYear =
    String(strValue.getFullYear()); 

             strValue
    =dCurYear +"/"+dCurMonth+ "/"+
    dCurDayOfMonth; 

             
    return
     strValue; 

    }
     

     

    //文件 test.html 

    <html:html> 

    <HEAD>
     

    <title>text</title>
     

    <meta http-equiv="Content-Language" content="ja">
     

    <meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
     

    </HEAD>
     

    <SCRIPT language="javascript" src="tenkey.js"></SCRIPT>
     

    <SCRIPT >
     

    function getDateValue(textValue,textId)


             
    return
     setDate(textValue,textId);   

    }
     

    </SCRIPT> 

    </head>
     

    <body>
     

             
    <input type="text" id="text1"/>
     

             
    <hr><br><br>
     

             
    <input type="button" onclick="getDateValue('','text1')" value="日期"/>
     

             
    <hr><br><br>
    ByValue 

             
    <input type="button" onclick="getDateValue('2004/4/05','text1')" value="日期"/>
     

    </body>
     

    </html:html>
     

     

     nullnullnullnull
    展开全文
  • 简单的html日期控件

    2016-10-02 21:13:13
    超好用简单的html日期控件。将整个文件夹拷贝到你的工程下,在html页面直接引用WdatePicker.js即可
  • php html日期控件.rar

    2020-06-26 20:15:00
    php日期控件php日期控件
  • html日期控件默认设置为当天日期

    万次阅读 2018-08-17 09:02:32
    最近在制作html+css+js的网站时,需要制作一个留言模块,在制作功能时有一个日期控件,需要实现对input里的value赋值当天日期。先前在各个网站找了许多相关说明。最初采用的方式是 html代码内 css样式里写: ...
  • 日期控件 <input type="date" id="date" name="date" value="" /> 日期控件默认设置为当天日期 var now = new Date(); //格式化日,如果小于9,前面补0 var day = ("0" + now.getDate()).slice(-2); ...
  • HTML日期控件的使用

    千次阅读 2017-10-22 17:41:28
    <HTML> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ${pageContext.request.cont
  • HTML日期控件修改版

    千次阅读 2007-03-27 11:22:00
    Chris.J的日期控件是个很好的东东,不过我使用的时候发觉有几个缺憾,不知道是我下载的版本问题还是代码本身就是这样的。问题如下:1、日期界面展开后,点“Today”无法获得当天的日期,而且界面无法关闭;2、日期...
  • 深度定制js日期控件,支持年月日+时分的显示,可根据要求设置日期显示、时间格式。
  • 日期控件html

    2019-09-23 18:56:02
    日期控件多的是,这里收录的是最简单的一种 <html> <head> <script type="text/javascript"> function DateSelector(selYear, selMonth, selDay) { this.selYear = selYear; this....
  • 日期控件

    2017-02-23 16:36:00
    一、Bootstrap日期控件: 二、jQuery日期控件: 三、layer日期控件: 转载于:https://www.cnblogs.com/softwarefang/p/6434136.html
  • WEB日期控件

    2019-04-26 13:57:00
    日期控件——my97 <div class="form-group"> <input type="text" class="Wdate form-control" name="start_time" onclick="WdatePicker({dateF...
  • 日期控件,里面html文件。日期控件,里面html文件。日期控件,里面html文件。
  • html5手机日期控件

    2014-08-12 08:28:04
    手机日期控件mobiscroll,可以让你的网页在手机访问时也能打开日期选择器。用纯html5写的,不是安卓开发。
  • jQuery日期控件

    2017-09-26 22:51:42
    html5新的日期控件为type=“date”,jQuery的日期控件编码如下。特点是外观非常漂亮,日期按钮有内凹的3D效果,并且随着鼠标的滑过,日期背景将会改变。
  • jquery手机日期控件_html5手机网页手机日期选择器代码 jquery手机日期控件_html5手机网页手机日期选择器代码 jquery手机日期控件_html5手机网页手机日期选择器代码
  • 日期 电脑端日期控件 开始时间 至 结束时间 插件
  • HTML日期选择控件

    热门讨论 2009-12-27 14:41:42
    简洁的HTML日期选择控件,给input添加获得焦点事件即可触发控件
  • HTML日期控件和时间控件 时间都是宝贵的,尤其是开发人员,所以为了节省时间,我直接展示下效果,符合您的要求就采纳,不符合,就不用继续看了! 日期控件效果: 时间控件展示: 日期控件 <div class="col-md-...
  • bootstrap日期控件

    2018-05-16 09:55:08
    Bootstrap 是基于 HTML、CSS、JavaScript 的,它简洁灵活,使得 Web 开发更加快捷。改包是bootstrap的日期控件
  • html5 日期时间控件

    2017-12-28 10:30:10
    支持手机的html5 日期时间控件
  • HTML中带时间的日期控件

    热门讨论 2008-11-19 18:36:11
    HTML中带时间的日期控件 HTML中带时间的日期控件

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,845
精华内容 738
关键字:

html日期控件