Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 3bacd45

Browse files
Foxandxsswesleycho
authored andcommitted
refactor(datepicker): order config options
Closes #5222
1 parent 1038c54 commit 3bacd45

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Diff for: src/datepicker/datepicker.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
33
.value('$datepickerSuppressError', false)
44

55
.constant('uibDatepickerConfig', {
6+
datepickerMode: 'day',
67
formatDay: 'dd',
78
formatMonth: 'MMMM',
89
formatYear: 'yyyy',
910
formatDayHeader: 'EEE',
1011
formatDayTitle: 'MMMM yyyy',
1112
formatMonthTitle: 'yyyy',
12-
datepickerMode: 'day',
13-
minMode: 'day',
13+
maxDate: null,
1414
maxMode: 'year',
15+
minDate: null,
16+
minMode: 'day',
17+
ngModelOptions: {},
18+
shortcutPropagation: false,
1519
showWeeks: true,
1620
startingDay: 0,
17-
yearRows: 4,
1821
yearColumns: 5,
19-
minDate: null,
20-
maxDate: null,
21-
shortcutPropagation: false,
22-
ngModelOptions: {}
22+
yearRows: 4
2323
})
2424

2525
.controller('UibDatepickerController', ['$scope', '$attrs', '$parse', '$interpolate', '$log', 'dateFilter', 'uibDatepickerConfig', '$datepickerSuppressError', 'uibDateParser',
@@ -553,6 +553,12 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
553553
})
554554

555555
.constant('uibDatepickerPopupConfig', {
556+
altInputFormats: [],
557+
appendToBody: false,
558+
clearText: 'Clear',
559+
closeOnDateSelection: true,
560+
closeText: 'Done',
561+
currentText: 'Today',
556562
datepickerPopup: 'yyyy-MM-dd',
557563
datepickerPopupTemplateUrl: 'uib/template/datepicker/popup.html',
558564
datepickerTemplateUrl: 'uib/template/datepicker/datepicker.html',
@@ -561,14 +567,8 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst
561567
'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',
562568
'month': 'yyyy-MM'
563569
},
564-
currentText: 'Today',
565-
clearText: 'Clear',
566-
closeText: 'Done',
567-
closeOnDateSelection: true,
568-
appendToBody: false,
569-
showButtonBar: true,
570570
onOpenFocus: true,
571-
altInputFormats: []
571+
showButtonBar: true
572572
})
573573

574574
.controller('UibDatepickerPopupController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$document', '$rootScope', '$uibPosition', 'dateFilter', 'uibDateParser', 'uibDatepickerPopupConfig', '$timeout', 'uibDatepickerConfig',

0 commit comments

Comments
 (0)