【发布时间】:2017-11-13 14:41:28
【问题描述】:
大家好,我想设置日期datepicker-options 设置最大和最小日期,但我有方法参数的最大和最小日期我如何在这里分配是我的代码
<input type="text" placeholder="Salary Date" uib-datepicker-popup="M/d/yyyy" ng-model="form.SalaryDate" is-open="form.opened" required="required" ng-click="popen($event,'opened')" ng-required="true" close-text="Close" datepicker-options="options" class="form-control" />
scope.Edit = function (salary) {
var salaryDate = new Date(salary.SalaryDate);
var s_dd = salaryDate.getDate();
var s_mm = salaryDate.getMonth();
var s_yy = salaryDate.getFullYear();
var currentDate = new Date();
var c_dd = currentDate.getDate();
var c_mm = currentDate.getMonth();
var c_yy = currentDate.getFullYear();
scope.options = {
minDate: new Date(s_yy, s_mm, s_dd),
maxDate: new Date(c_yy, c_mm, c_dd)
};
};
但此代码不起作用。它显示所有月份。请帮助我如何解决这个问题
【问题讨论】:
标签: jquery angularjs datepicker