将第一个输入类型日期值设置为 angularjs 中第二个输入日期类型的最小日期值
Setting First input type date value as the min date value of the second input date type in angularjs
我有两个输入类型的日期字段,我需要将第一个输入日期类型的选定日期作为第二个输入日期类型的最小日期。我怎样才能做到这一点?请找到我现有的代码。
<html>
<input type="date" ng-model="date1" required/>
<input type="date" ng-model="date2" required/>
</html>
您可以添加以下代码片段来实现要求。
<html>
<input type="date" ng-model="date1" required/>
<input type="date" ng-model="date2" required min="{{date1 | date:'yyyy-MM-dd'}}"/>
</html>
我有两个输入类型的日期字段,我需要将第一个输入日期类型的选定日期作为第二个输入日期类型的最小日期。我怎样才能做到这一点?请找到我现有的代码。
<html>
<input type="date" ng-model="date1" required/>
<input type="date" ng-model="date2" required/>
</html>
您可以添加以下代码片段来实现要求。
<html>
<input type="date" ng-model="date1" required/>
<input type="date" ng-model="date2" required min="{{date1 | date:'yyyy-MM-dd'}}"/>
</html>