forked from zhaber/ng-bootstrap-datetimepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.js
42 lines (33 loc) · 1004 Bytes
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
angular.module('plunker', ['ui.bootstrap', 'ui.bootstrap.datetimepicker'])
var DateTimePickerDemoCtrl = function ($scope, $timeout) {
$scope.dateTimeNow = function() {
$scope.date = new Date();
};
$scope.dateTimeNow();
$scope.toggleMinDate = function() {
$scope.minDate = $scope.minDate ? null : new Date();
};
$scope.maxDate = new Date('2014-06-22');
$scope.toggleMinDate();
$scope.dateOptions = {
startingDay: 1,
showWeeks: false
};
$scope.$watch('date', function () {
alert('changed');
});
// Disable weekend selection
$scope.disabled = function(calendarDate, mode) {
return mode === 'day' && ( calendarDate.getDay() === 0 || calendarDate.getDay() === 6 );
};
$scope.hourStep = 1;
$scope.minuteStep = 15;
$scope.timeOptions = {
hourStep: [1, 2, 3],
minuteStep: [1, 5, 10, 15, 25, 30]
};
$scope.showMeridian = true;
$scope.timeToggleMode = function() {
$scope.showMeridian = !$scope.showMeridian;
};
};