@@ -17,13 +17,12 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
17
17
ngModelOptions : { } ,
18
18
shortcutPropagation : false ,
19
19
showWeeks : true ,
20
- startingDay : 0 ,
21
20
yearColumns : 5 ,
22
21
yearRows : 4
23
22
} )
24
23
25
- . controller ( 'UibDatepickerController' , [ '$scope' , '$attrs' , '$parse' , '$interpolate' , '$log' , 'dateFilter' , 'uibDatepickerConfig' , '$datepickerSuppressError' , 'uibDateParser' ,
26
- function ( $scope , $attrs , $parse , $interpolate , $log , dateFilter , datepickerConfig , $datepickerSuppressError , dateParser ) {
24
+ . controller ( 'UibDatepickerController' , [ '$scope' , '$attrs' , '$parse' , '$interpolate' , '$locale' , '$ log', 'dateFilter' , 'uibDatepickerConfig' , '$datepickerSuppressError' , 'uibDateParser' ,
25
+ function ( $scope , $attrs , $parse , $interpolate , $locale , $ log, dateFilter , datepickerConfig , $datepickerSuppressError , dateParser ) {
27
26
var self = this ,
28
27
ngModelCtrl = { $setViewValue : angular . noop } , // nullModelCtrl;
29
28
ngModelOptions = { } ,
@@ -38,10 +37,19 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
38
37
} ) ;
39
38
40
39
// Evaled configuration attributes
41
- angular . forEach ( [ 'showWeeks' , 'startingDay' , 'yearRows' , 'yearColumns' , 'shortcutPropagation' ] , function ( key ) {
42
- self [ key ] = angular . isDefined ( $attrs [ key ] ) ? $scope . $parent . $eval ( $attrs [ key ] ) : datepickerConfig [ key ] ;
40
+ angular . forEach ( [ 'showWeeks' , 'yearRows' , 'yearColumns' , 'shortcutPropagation' ] , function ( key ) {
41
+ self [ key ] = angular . isDefined ( $attrs [ key ] ) ?
42
+ $scope . $parent . $eval ( $attrs [ key ] ) : datepickerConfig [ key ] ;
43
43
} ) ;
44
44
45
+ if ( angular . isDefined ( $attrs . startingDay ) ) {
46
+ self . startingDay = $scope . $parent . $eval ( $attrs . startingDay ) ;
47
+ } else if ( angular . isNumber ( datepickerConfig . startingDay ) ) {
48
+ self . startingDay = datepickerConfig . startingDay ;
49
+ } else {
50
+ self . startingDay = ( $locale . DATETIME_FORMATS . FIRSTDAYOFWEEK + 8 ) % 7 ;
51
+ }
52
+
45
53
// Watchable date attributes
46
54
angular . forEach ( [ 'minDate' , 'maxDate' ] , function ( key ) {
47
55
if ( $attrs [ key ] ) {
0 commit comments