diff --git a/src/core_plugins/kibana/public/kibana.js b/src/core_plugins/kibana/public/kibana.js index 222964447c3a..4465c7c93541 100644 --- a/src/core_plugins/kibana/public/kibana.js +++ b/src/core_plugins/kibana/public/kibana.js @@ -35,10 +35,16 @@ chrome }); config.watch('dateFormat:tz', setDefaultTimezone, $scope); + config.watch('dateFormat:dow', setStartDayOfWeek, $scope); function setDefaultTimezone(tz) { moment.tz.setDefault(tz); } + + function setStartDayOfWeek(day) { + const dow = moment.weekdays().indexOf(day); + moment.updateLocale(moment.locale(), { week: { dow } }); + } }); modules.get('kibana').run(Notifier.pullMessageFromUrl); diff --git a/src/ui/public/timepicker/kbn_global_timepicker.js b/src/ui/public/timepicker/kbn_global_timepicker.js index 2e730897d5ec..b4323d26dbcc 100644 --- a/src/ui/public/timepicker/kbn_global_timepicker.js +++ b/src/ui/public/timepicker/kbn_global_timepicker.js @@ -19,12 +19,6 @@ UiModules return { template: toggleHtml, link: ($scope, $el, attrs) => { - config.bindToScope($scope, 'dateFormat:dow', 'dateFormat_dow'); - $scope.$watch('dateFormat_dow', function (day) { - const dow = moment.weekdays().indexOf(day); - moment.locale(moment.locale(), { week: { dow } }); - }); - listenForUpdates($rootScope); $rootScope.timefilter = timefilter;