【问题标题】:Setting First input type date value as the min date value of the second input date type in angularjs将第一个输入类型日期值设置为angularjs中第二个输入日期类型的最小日期值
【发布时间】:2019-10-04 07:28:15
【问题描述】:

我有两个输入类型日期字段,我需要将第一个输入日期类型的选定日期作为第二个输入日期类型的最小日期。我怎样才能做到这一点?请找到我现有的代码。

<html>
<input type="date" ng-model="date1" required/>
<input type="date" ng-model="date2" required/>
</html>

【问题讨论】:

    标签: html angularjs date calendar


    【解决方案1】:

    可以添加如下代码sn -p来实现需求。

    <html>
    <input type="date" ng-model="date1" required/>
    <input type="date" ng-model="date2" required min="{{date1 | date:'yyyy-MM-dd'}}"/>
    </html>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-26
      • 2021-09-17
      • 1970-01-01
      • 2020-03-25
      • 2021-04-26
      • 2014-09-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多