diff --git a/docs/advanced-settings.asciidoc b/docs/advanced-settings.asciidoc index 2d72ac308f00..646a6860821c 100644 --- a/docs/advanced-settings.asciidoc +++ b/docs/advanced-settings.asciidoc @@ -1,7 +1,7 @@ [[kibana-settings-reference]] -WARNING: Modifying the following settings can signficantly affect Kibana's performance and cause problems that are -difficult to diagnose. Setting a property's value to a blank field will revert to the default behavior, which may not be +WARNING: Modifying the following settings can signficantly affect Kibana's performance and cause problems that are +difficult to diagnose. Setting a property's value to a blank field will revert to the default behavior, which may not be compatible with other configuration settings. Deleting a custom setting removes it from Kibana permanently. .Kibana Settings Reference @@ -10,38 +10,39 @@ compatible with other configuration settings. Deleting a custom setting removes `sort:options`:: Options for the Elasticsearch https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html[sort] parameter. `dateFormat`:: The format to use for displaying pretty-formatted dates. `dateFormat:tz`:: The timezone that Kibana uses. The default value of `Browser` uses the timezone detected by the browser. -`dateFormat:scaled`:: These values define the format used to render ordered time-based data. Formatted timestamps must +`dateFormat:scaled`:: These values define the format used to render ordered time-based data. Formatted timestamps must +`dateFormat:dow`:: This property defines what day weeks should start on. adapt to the interval between measurements. Keys are http://en.wikipedia.org/wiki/ISO_8601#Time_intervals[ISO8601 intervals]. `defaultIndex`:: Default is `null`. This property specifies the default index. -`metaFields`:: An array of fields outside of `_source`. Kibana merges these fields into the document when displaying the +`metaFields`:: An array of fields outside of `_source`. Kibana merges these fields into the document when displaying the document. `defaultColumns`:: Default is `_source`. Defines the columns that appear by default on the Discover page. `discover:sampleSize`:: The number of rows to show in the Discover table. -`doc_table:highlight`:: Highlight results in Discover and Saved Searches Dashboard. Highlighing makes request slow when +`doc_table:highlight`:: Highlight results in Discover and Saved Searches Dashboard. Highlighing makes request slow when working on big documents. Set this property to `false` to disable highlighting. -`courier:maxSegmentCount`:: Kibana splits requests in the Discover app into segments to limit the size of requests sent to -the Elasticsearch cluster. This setting constrains the length of the segment list. Long segment lists can significantly +`courier:maxSegmentCount`:: Kibana splits requests in the Discover app into segments to limit the size of requests sent to +the Elasticsearch cluster. This setting constrains the length of the segment list. Long segment lists can significantly increase request processing time. `fields:popularLimit`:: This setting governs how many of the top most popular fields are shown. `histogram:barTarget`:: When date histograms use the `auto` interval, Kibana attempts to generate this number of bars. -`histogram:maxBars`:: Date histograms are not generated with more bars than the value of this property, scaling values +`histogram:maxBars`:: Date histograms are not generated with more bars than the value of this property, scaling values when necessary. -`visualization:tileMap:maxPrecision`:: The maximum geoHash precision displayed on tile maps: 7 is high, 10 is very high, +`visualization:tileMap:maxPrecision`:: The maximum geoHash precision displayed on tile maps: 7 is high, 10 is very high, 12 is the maximum. http://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html#_cell_dimensions_at_the_equator[Explanation of cell dimensions]. `visualization:tileMap:WMSdefaults`:: Default properties for the WMS map server support in the tile map. `visualization:colorMapping`:: Maps values to specified colors within visualizations. `visualization:loadingDelay`:: Time to wait before dimming visualizations during query. `csv:separator`:: A string that serves as the separator for exported values. `csv:quoteValues`:: Set this property to `true` to quote exported values. -`history:limit`:: In fields that have history, such as query inputs, the value of this property limits how many recent +`history:limit`:: In fields that have history, such as query inputs, the value of this property limits how many recent values are shown. -`shortDots:enable`:: Set this property to `true` to shorten long field names in visualizations. For example, instead of +`shortDots:enable`:: Set this property to `true` to shorten long field names in visualizations. For example, instead of `foo.bar.baz`, show `f.b.baz`. -`truncate:maxHeight`:: This property specifies the maximum height that a cell occupies in a table. A value of 0 disables +`truncate:maxHeight`:: This property specifies the maximum height that a cell occupies in a table. A value of 0 disables truncation. -`indexPattern:fieldMapping:lookBack`:: The value of this property sets the number of recent matching patterns to query the +`indexPattern:fieldMapping:lookBack`:: The value of this property sets the number of recent matching patterns to query the field mapping for index patterns with names that contain timestamps. -`format:defaultTypeMap`:: A map of the default format name for each field type. Field types that are not explicitly +`format:defaultTypeMap`:: A map of the default format name for each field type. Field types that are not explicitly mentioned use "_default_". `format:number:defaultPattern`:: Default numeral format for the "number" format. `format:bytes:defaultPattern`:: Default numeral format for the "bytes" format. diff --git a/src/ui/public/config/defaults.js b/src/ui/public/config/defaults.js index e5c3590653d4..adf14779fbfc 100644 --- a/src/ui/public/config/defaults.js +++ b/src/ui/public/config/defaults.js @@ -2,8 +2,10 @@ import moment from 'moment-timezone'; import _ from 'lodash'; export default function configDefaultsProvider() { - // wrapped in provider so that a new instance is given to each app/test + const weekdays = moment.weekdays().slice(); + const [defaultWeekday] = weekdays; + // wrapped in provider so that a new instance is given to each app/test return { 'buildNum': { readonly: true @@ -46,6 +48,12 @@ export default function configDefaultsProvider() { ' ' + 'ISO8601 intervals.' }, + 'dateFormat:dow': { + value: defaultWeekday, + description: 'What day should weeks start on?', + type: 'select', + options: weekdays + }, 'defaultIndex': { value: null, description: 'The index to access if no index is set', diff --git a/src/ui/public/timefilter/timefilter.js b/src/ui/public/timefilter/timefilter.js index 47598b63a5db..e3e1bac668b2 100644 --- a/src/ui/public/timefilter/timefilter.js +++ b/src/ui/public/timefilter/timefilter.js @@ -19,11 +19,9 @@ uiRoutes uiModules .get('kibana') .service('timefilter', function (Private, globalState, $rootScope, config) { - let Events = Private(EventsProvider); let diff = Private(UtilsDiffTimePickerValsProvider); - function convertISO8601(stringTime) { let obj = moment(stringTime, 'YYYY-MM-DDTHH:mm:ss.SSSZ', true); return obj.isValid() ? obj : stringTime; diff --git a/src/ui/public/timepicker/kbn_global_timepicker.js b/src/ui/public/timepicker/kbn_global_timepicker.js index 33ff002ea1d1..8e0912d88793 100644 --- a/src/ui/public/timepicker/kbn_global_timepicker.js +++ b/src/ui/public/timepicker/kbn_global_timepicker.js @@ -1,3 +1,4 @@ +import moment from 'moment'; import UiModules from 'ui/modules'; import chromeNavControlsRegistry from 'ui/registry/chrome_nav_controls'; import { once, clone } from 'lodash'; @@ -6,7 +7,7 @@ import toggleHtml from './kbn_global_timepicker.html'; UiModules .get('kibana') -.directive('kbnGlobalTimepicker', (timefilter, globalState, $rootScope) => { +.directive('kbnGlobalTimepicker', (timefilter, globalState, $rootScope, config) => { const listenForUpdates = once($scope => { $scope.$listen(timefilter, 'update', (newVal, oldVal) => { globalState.time = clone(timefilter.time); @@ -18,6 +19,12 @@ UiModules return { template: toggleHtml, link: ($scope, $el, attrs) => { + config.$bind($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; diff --git a/src/ui/public/timepicker/timepicker.js b/src/ui/public/timepicker/timepicker.js index 6dd671ef818d..a61b38c857e6 100644 --- a/src/ui/public/timepicker/timepicker.js +++ b/src/ui/public/timepicker/timepicker.js @@ -15,7 +15,6 @@ let notify = new Notifier({ location: 'timepicker', }); - module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshIntervals) { return { restrict: 'E', @@ -28,10 +27,6 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter }, template: html, controller: function ($scope) { - let init = function () { - $scope.setMode($scope.mode); - }; - $scope.format = 'MMMM Do YYYY, HH:mm:ss.SSS'; $scope.modes = ['quick', 'relative', 'absolute']; $scope.activeTab = $scope.activeTab || 'filter'; @@ -115,7 +110,7 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter $scope.mode = thisMode; }; - $scope.setQuick = function (from, to, description) { + $scope.setQuick = function (from, to) { $scope.from = from; $scope.to = to; }; @@ -154,7 +149,7 @@ module.directive('kbnTimepicker', function (quickRanges, timeUnits, refreshInter $scope.interval = interval; }; - init(); + $scope.setMode($scope.mode); } }; });