设置最大日期和最小日期为html 3个月最大值

时间:2018-02-06 13:43:31

标签: javascript jquery html

<input type='date' class="form-control" id ="datepicker11" />

 <script> $('#datepicker11').datepicker({   maxDate: '+3m',   minDate: '+1d' })  </script>

我只想将最短的一天设定为当前日期的一天,最多为当天的3个月。

1 个答案:

答案 0 :(得分:0)

您可以按照以下方式执行此操作:

<div style="text-align: center;">
    <h1 >SWITCHES</h1>
    <div ng-controller="homeController">

        <div style="display:inline-block;">
            <button ng-click="onOf()" class="homeSwitchButton">{{button1}}</button>
            <img class="homeButtonImage" src="{{imageSrc}}" alt="Lamp" >
        </div>

        <div style="display:inline-block;">
            <button ng-click="onOf()" class="homeSwitchButton">{{button2}}</button>
            <img class="homeButtonImage" src="{{imageSrc}}" alt="Lamp" >
        </div>

        <div style="display:inline-block;">
            <button ng-click="onOf()" class="homeSwitchButton">{{button3}}</button>
            <img class="homeButtonImage" src="{{imageSrc}}" alt="Lamp" >
        </div>

        <div style="display:inline-block;">
            <button ng-click="onOf()" class="homeSwitchButton">{{button4}}</button>
            <img class="homeButtonImage" src="{{imageSrc}}" alt="Lamp" >
        </div>

    </div>
</div>

此处正在运作Fiddle