Skip to content

Commit

Permalink
Merge pull request #7806 from jbudz/moment-locale
Browse files Browse the repository at this point in the history
Fix moment deprecation, move dow config
  • Loading branch information
jbudz authored Jul 25, 2016
2 parents 377f23c + d3187d0 commit 27c3836
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.locale(moment.locale(), { week: { dow } });
});

listenForUpdates($rootScope);

$rootScope.timefilter = timefilter;
Expand Down

0 comments on commit 27c3836

Please sign in to comment.