Skip to content

Commit

Permalink
[config] Move day of week next to timezone config
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Jul 22, 2016
1 parent 2f44298 commit d3187d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/core_plugins/kibana/public/kibana.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
6 changes: 0 additions & 6 deletions src/ui/public/timepicker/kbn_global_timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.updateLocale(moment.locale(), { week: { dow } });
});

listenForUpdates($rootScope);

$rootScope.timefilter = timefilter;
Expand Down

0 comments on commit d3187d0

Please sign in to comment.