HTML代码:
Start Date angularJs:
$scope.add=function(){ alert($scope.holiday.startDate);}
发布于 2017-05-31 13:50:00
我希望你已经添加了this插件后,添加插件注入到你的app.js,然后遵循以下程序
你的HTML代码
<label for="inputCreated">Input date</label>
<input input-date
type="text"
name="created"
id="inputCreated"
ng-model="currentTime"
container=""
format="dd/mm/yyyy"
months-full="{{ month }}"
months-short="{{ monthShort }}"
weekdays-full="{{ weekdaysFull }}"
weekdays-short="{{ weekdaysShort }}"
weekdays-letter="{{ weekdaysLetter }}"
disable="disable"
min="{{ minDate }}"
max="{{ maxDate }}"
today="today"
first-day="1"
clear="clear"
close="close"
select-years="15"
on-start="onStart()"
on-render="onRender()"
on-open="onOpen()"
on-close="onClose()"
on-set="onSet()"
on-stop="onStop()" />
你的angular js代码
$scope.clear = 'Clear';
$scope.close = 'Close';
var days = 15;
$scope.minDate = (new Date($scope.currentTime.getTime() - ( 1000 * 60 * 60 *24 * days ))).toISOString();
$scope.maxDate = (new Date($scope.currentTime.getTime() + ( 1000 * 60 * 60 *24 * days ))).toISOString();
$scope.onStart = function () {
console.log('onStart');
};
$scope.onRender = function () {
console.log('onRender');
};
$scope.onOpen = function () {
console.log('onOpen');
};
$scope.onClose = function () {
console.log('onClose');
};
$scope.onSet = function () {
console.log('onSet');
};
$scope.onStop = function () {
console.log('onStop');
};
有关更多详细信息,请访问this链接
https://stackoverflow.com/questions/44276146
复制相似问题