From 81be849e4a8c96daa9c967d1198dfaf950107cde Mon Sep 17 00:00:00 2001 From: Foxandxss Date: Tue, 12 Jan 2016 12:27:39 +0100 Subject: [PATCH] refactor(datepicker): order config options --- src/datepicker/datepicker.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index 5ec93d034f..4f7db572f7 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -3,23 +3,23 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst .value('$datepickerSuppressError', false) .constant('uibDatepickerConfig', { + datepickerMode: 'day', formatDay: 'dd', formatMonth: 'MMMM', formatYear: 'yyyy', formatDayHeader: 'EEE', formatDayTitle: 'MMMM yyyy', formatMonthTitle: 'yyyy', - datepickerMode: 'day', - minMode: 'day', + maxDate: null, maxMode: 'year', + minDate: null, + minMode: 'day', + ngModelOptions: {}, + shortcutPropagation: false, showWeeks: true, startingDay: 0, - yearRows: 4, yearColumns: 5, - minDate: null, - maxDate: null, - shortcutPropagation: false, - ngModelOptions: {} + yearRows: 4 }) .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 }) .constant('uibDatepickerPopupConfig', { + altInputFormats: [], + appendToBody: false, + clearText: 'Clear', + closeOnDateSelection: true, + closeText: 'Done', + currentText: 'Today', datepickerPopup: 'yyyy-MM-dd', datepickerPopupTemplateUrl: 'uib/template/datepicker/popup.html', datepickerTemplateUrl: 'uib/template/datepicker/datepicker.html', @@ -561,14 +567,8 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootst 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss', 'month': 'yyyy-MM' }, - currentText: 'Today', - clearText: 'Clear', - closeText: 'Done', - closeOnDateSelection: true, - appendToBody: false, - showButtonBar: true, onOpenFocus: true, - altInputFormats: [] + showButtonBar: true }) .controller('UibDatepickerPopupController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$document', '$rootScope', '$uibPosition', 'dateFilter', 'uibDateParser', 'uibDatepickerPopupConfig', '$timeout', 'uibDatepickerConfig',