dojo?????????DateTextBox???

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了dojo?????????DateTextBox???相关的知识,希望对你有一定的参考价值。

?????????head   class   script   center   lang   meta   tle   header   comm   

1???????????????

???1?????????dojo???DateTextBox??????????????????????????????????????????????????????

???2????????????????????????????????????????????????????????????????????????????????????????????????RadioButton??????????????????

2???????????????

     ?????????????????????????????????????????????

 

<label for="startDate" style=???color:#FF0000;???>???????????????</label>
                    <input id="startDate" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"startDate", 
                                            constraints:{datePattern:"yyyy-MM-dd"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("endDate").constraints.min = this.get("value"); } ???/>

<label for="endDate" style=???color:#FF0000;???>???????????????</label>
                    <input id="endDate" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"endDate", 
                                            constraints:{datePattern:"yyyy-MM-dd"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("startDate").constraints.min = this.get("value"); } ???/>

????????????????????????

 

????????????

    ?????????????????????????????????????????????

 

<label for="startMonth" style=???color:#00FF00;???>???????????????</label>
                    <input id="startMonth" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"startMonth", 
                                            constraints:{datePattern:"yyyy-MM"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("endMonth").constraints.min = this.get("value"); } ???/>

<label for="endMonth" style=???color:#00FF00;???>???????????????</label>
                    <input id="endMonth" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"endMonth", 
                                            constraints:{datePattern:"yyyy-MM"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("startMonth").constraints.min = this.get("value"); } ???/>

????????????????????????

 

????????????

    ?????????????????????????????????????????????

 

<label for="startYear" style=???color:#0000FF;???>???????????????</label>
                    <input id="startYear" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"startYear", 
                                            constraints:{datePattern:"yyyy"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("endYear").constraints.min = this.get("value"); } ???/>

<label for="endYear" style=???color:#0000FF;???>???????????????</label>
                    <input id="endYear" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"endYear", 
                                            constraints:{datePattern:"yyyy"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("startYear").constraints.min = this.get("value"); } ???/>

 

 

?????????????????????

????????????
   

   ?????????????????????????????????

 

<input type=???radio??? data-dojo-type=???dijit/form/RadioButton??? name=???date??? checked=???checked???/>
                    <label for="byDay" style=???color:#00FFFF;???>?????????</label>
                    <input id="byDay" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"byDay", 
                                            constraints:{datePattern:"yyyy-MM-dd"},
                                            required:true,
                                            value:new Date()???/>

<input type=???radio??? data-dojo-type=???dijit/form/RadioButton??? name=???date???/>
                    <label for="byMonth" style=???color:#00FFFF;???>?????????</label>
                    <input id="byMonth" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"byMonth", 
                                            constraints:{datePattern:"yyyy-MM"},
                                            required:true,
                                            value:new Date()???/>

?????????????????????

 

????????????

3?????????

?????????

 

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>DateTextBox</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <link  rel="stylesheet" href="../script/dojoroot/dijit/themes/claro/claro.css"/>
        <script type="text/javascript" src="../script/dojoroot/dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true"></script>
        <style type="text/css">
            body{
                width:100%;
                height:100%;
                font-size:12px;
            }
            #tab{
                width:80%;
                height:30px;
                font-weight:bold;
            }
        </style>
        <script type="text/javascript">
            dojo.require("dijit.form.DateTextBox");
        </script>
    </head>
    <body class="claro" role="main">
        <table id="tab">
            <tr>
                <!--??????????????????-->
                <td>
                    <label for="startDate" style=???color:#FF0000;???>???????????????</label>
                    <input id="startDate" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"startDate", 
                                            constraints:{datePattern:"yyyy-MM-dd"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("endDate").constraints.min = this.get("value"); } ???/>
                </td>
                <!--??????????????????-->
                <td>
                    <label for="startMonth" style=???color:#00FF00;???>???????????????</label>
                    <input id="startMonth" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"startMonth", 
                                            constraints:{datePattern:"yyyy-MM"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("endMonth").constraints.min = this.get("value"); } ???/>
                </td>
                <!--??????????????????-->
                <td>
                    <label for="startYear" style=???color:#0000FF;???>???????????????</label>
                    <input id="startYear" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"startYear", 
                                            constraints:{datePattern:"yyyy"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("endYear").constraints.min = this.get("value"); } ???/>
                </td>
                <!--????????????-->
                <td>
                    <input type=???radio??? data-dojo-type=???dijit/form/RadioButton??? name=???date??? checked=???checked???/>
                    <label for="byDay" style=???color:#00FFFF;???>?????????</label>
                    <input id="byDay" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"byDay", 
                                            constraints:{datePattern:"yyyy-MM-dd"},
                                            required:true,
                                            value:new Date()???/>
                </td>
            </tr>
            <tr>
                <!--??????????????????-->
                <td>
                    <label for="endDate" style=???color:#FF0000;???>???????????????</label>
                    <input id="endDate" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"endDate", 
                                            constraints:{datePattern:"yyyy-MM-dd"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("startDate").constraints.min = this.get("value"); } ???/>
                </td> 
                <!--??????????????????-->
                <td>
                    <label for="endMonth" style=???color:#00FF00;???>???????????????</label>
                    <input id="endMonth" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"endMonth", 
                                            constraints:{datePattern:"yyyy-MM"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("startMonth").constraints.min = this.get("value"); } ???/>
                </td>
                <!--??????????????????-->
                <td>
                    <label for="endYear" style=???color:#0000FF;???>???????????????</label>
                    <input id="endYear" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"endYear", 
                                            constraints:{datePattern:"yyyy"},
                                            required:true,
                                            value:new Date(),
					    onChange:function(){ dijit.byId("startYear").constraints.min = this.get("value"); } ???/>
                </td>
                <!--????????????-->
                <td>
                    <input type=???radio??? data-dojo-type=???dijit/form/RadioButton??? name=???date???/>
                    <label for="byMonth" style=???color:#00FFFF;???>?????????</label>
                    <input id="byMonth" 
                           data-dojo-type="dijit/form/DateTextBox"
			   data-dojo-props=???type:"text", 
                                            style:"width:100px;",
                                            name:"byMonth", 
                                            constraints:{datePattern:"yyyy-MM"},
                                            required:true,
                                            value:new Date()???/>
                </td>
            </tr>
        </table> 
    </body>
</html>

????????????

 

 

??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????https://blog.csdn.net/jiangjunshow














以上是关于dojo?????????DateTextBox???的主要内容,如果未能解决你的问题,请参考以下文章

如何以给定格式从 dijit.form.DateTextBox 获取日期?

如何将 dijit.form.DateTextBox 的初始值设置为今天?

是否可以为 dijit.form.DateTextBox 指定显示格式

Dijit DateTextBox 上的限制 [一周中的有效日期]

iframe子页怎么获取父页的window对象

dojo常用函数