Merge pull request #7806 from jbudz/moment-locale

Fix moment deprecation, move dow config
This commit is contained in:
Jonathan Budzenski 2016-07-25 07:20:49 -05:00 committed by GitHub
commit 27c3836c38
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.locale(moment.locale(), { week: { dow } });
});
listenForUpdates($rootScope);
$rootScope.timefilter = timefilter;