Skip to content

Commit 34df528

Browse files
committed
fix(demo): Add missing boostrap icons and make datepicker pop at current date
Bootstrap icons have been added. When opening datepickers for date range configuration, it now opens at current date from the demo.
1 parent bd5be2f commit 34df528

10 files changed

+246
-15
lines changed

Diff for: demo/Gruntfile.js

+5
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,11 @@ module.exports = function (grunt) {
341341
cwd: 'bower_components/font-awesome',
342342
dest: '<%= yeoman.dist %>',
343343
src: ['fonts/*']
344+
}, { // Add boostrap fonts
345+
expand: true,
346+
cwd: 'bower_components/bootstrap',
347+
dest: '<%= yeoman.dist %>',
348+
src: ['fonts/*']
344349
}]
345350
},
346351
styles: {

Diff for: demo/app/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ <h4 class="panel-title">
116116
<div class="form-group text-center">
117117
<label class="control-label"><i class="fa fa-calendar"></i> <i class="fa fa-arrows-h"></i> <i class="fa fa-calendar"></i> Date range</label><br>
118118
<div class="form-group">
119-
<input type="text" class="form-control" ng-model="options.fromDate" data-max-date="{{options.toDate}}" placeholder="From" bs-datepicker>
119+
<input type="text" class="form-control" ng-model="options.fromDate" max-date="{{options.toDate}}" start-date="{{options.currentDateValue.toString()}}" start-week="1" placeholder="From" bs-datepicker>
120120
</div>
121121
<div class="form-group">
122-
<input type="text" class="form-control" ng-model="options.toDate" data-min-date="{{options.fromDate}}" placeholder="To" bs-datepicker>
122+
<input type="text" class="form-control" ng-model="options.toDate" min-date="{{options.fromDate}}" start-date="{{options.currentDateValue.toString()}}" start-week="1" placeholder="To" bs-datepicker>
123123
</div>
124124
</div>
125125

@@ -176,7 +176,7 @@ <h4 class="panel-title">
176176
weekend-days="[0,6]"
177177
show-weekends="options.showWeekends"
178178
current-date="options.currentDate"
179-
current-date-value="currentDate"
179+
current-date-value="options.currentDateValue"
180180
max-height="options.maxHeight && 300 || 0"
181181
on-scroll="scrollEvent(event)">
182182
</gantt>

Diff for: demo/app/scripts/controllers/main.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ angular.module('angularGanttDemoApp')
2121
showWeekends: true,
2222
showNonWorkHours: true,
2323
currentDate: 'line',
24+
currentDateValue : new Date(2013, 9, 23, 11, 20, 0),
2425
draw: false,
2526
readOnly: false,
2627
filterTask: undefined,
@@ -32,14 +33,11 @@ angular.module('angularGanttDemoApp')
3233
$scope.options.toDate = $scope.toDate;
3334
});
3435

35-
// Get today date for currentDate indicator
36-
$scope.currentDate = new Date(2013, 9, 23, 11, 20, 0);
37-
3836
$scope.$on(GANTT_EVENTS.READY, function() {
3937
$scope.loadTimespans(Sample.getSampleTimespans().timespan1);
4038
$scope.loadData(Sample.getSampleData().data1);
4139
$timeout(function() {
42-
$scope.scrollToDate($scope.currentDate);
40+
$scope.scrollToDate($scope.options.currentDateValue);
4341
}, 0, true);
4442
});
4543

Diff for: demo/bower.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"angular-strap": "~2.1.0",
1616
"font-awesome": "~4.2.0",
1717
"moment": "~2.8.3",
18-
"angular-gantt": "https://github.com/angular-gantt/angular-gantt.git#master"
18+
"angular-gantt": "https://github.com/angular-gantt/angular-gantt.git#master",
19+
"bootstrap": "~3.2.0"
1920
},
2021
"devDependencies": {
2122
"angular-mocks": "~1.2.0"

Diff for: demo/dist/fonts/glyphicons-halflings-regular.eot

19.9 KB
Binary file not shown.

Diff for: demo/dist/fonts/glyphicons-halflings-regular.svg

+229
Loading

Diff for: demo/dist/fonts/glyphicons-halflings-regular.ttf

40.3 KB
Binary file not shown.

Diff for: demo/dist/fonts/glyphicons-halflings-regular.woff

22.8 KB
Binary file not shown.

Diff for: demo/dist/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ <h4 class="panel-title">
107107
<div class="form-group text-center">
108108
<label class="control-label"><i class="fa fa-calendar"></i> <i class="fa fa-arrows-h"></i> <i class="fa fa-calendar"></i> Date range</label><br>
109109
<div class="form-group">
110-
<input type="text" class="form-control" ng-model="options.fromDate" data-max-date="{{options.toDate}}" placeholder="From" bs-datepicker>
110+
<input type="text" class="form-control" ng-model="options.fromDate" max-date="{{options.toDate}}" start-date="{{options.currentDateValue.toString()}}" start-week="1" placeholder="From" bs-datepicker>
111111
</div>
112112
<div class="form-group">
113-
<input type="text" class="form-control" ng-model="options.toDate" data-min-date="{{options.fromDate}}" placeholder="To" bs-datepicker>
113+
<input type="text" class="form-control" ng-model="options.toDate" min-date="{{options.fromDate}}" start-date="{{options.currentDateValue.toString()}}" start-week="1" placeholder="To" bs-datepicker>
114114
</div>
115115
</div>
116116

@@ -167,7 +167,7 @@ <h4 class="panel-title">
167167
weekend-days="[0,6]"
168168
show-weekends="options.showWeekends"
169169
current-date="options.currentDate"
170-
current-date-value="currentDate"
170+
current-date-value="options.currentDateValue"
171171
max-height="options.maxHeight && 300 || 0"
172172
on-scroll="scrollEvent(event)">
173173
</gantt>

Diff for: demo/dist/scripts/scripts.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ angular.module('angularGanttDemoApp')
3737
showWeekends: true,
3838
showNonWorkHours: true,
3939
currentDate: 'line',
40+
currentDateValue : new Date(2013, 9, 23, 11, 20, 0),
4041
draw: false,
4142
readOnly: false,
4243
filterTask: undefined,
@@ -48,14 +49,11 @@ angular.module('angularGanttDemoApp')
4849
$scope.options.toDate = $scope.toDate;
4950
});
5051

51-
// Get today date for currentDate indicator
52-
$scope.currentDate = new Date(2013, 9, 23, 11, 20, 0);
53-
5452
$scope.$on(GANTT_EVENTS.READY, function() {
5553
$scope.loadTimespans(Sample.getSampleTimespans().timespan1);
5654
$scope.loadData(Sample.getSampleData().data1);
5755
$timeout(function() {
58-
$scope.scrollToDate($scope.currentDate);
56+
$scope.scrollToDate($scope.options.currentDateValue);
5957
}, 0, true);
6058
});
6159

0 commit comments

Comments
 (0)