[config] Move day of week next to timezone config

This commit is contained in:
Jonathan Budzenski 2016-07-22 12:28:36 -05:00
parent 2f44298758
commit d3187d0c63
2 changed files with 6 additions and 6 deletions

View file

@ -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);

View file

@ -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;