mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Merge pull request #7806 from jbudz/moment-locale
Fix moment deprecation, move dow config
This commit is contained in:
commit
27c3836c38
2 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue