Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated kbnIndex.indices function to issue for non-UTC users #1489

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/components/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function (_) {
elasticsearch : "http://"+window.location.hostname+":9200",
panel_names : [],
kibana_index : 'kibana-int',
default_route : '/dashboard/file/default.json'
default_route : '/dashboard/file/default.json',
utc_tz : true
};

// This initializes a new hash on purpose, to avoid adding parameters to
Expand Down
6 changes: 5 additions & 1 deletion src/app/services/kbnIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ function (angular, _, config, moment) {
this.indices = function(from,to,pattern,interval) {
var possible = [];
_.each(expand_range(from,to,interval),function(d){
possible.push(d.utc().format(pattern));
if (config.utc_tz === true) {
possible.push(d.utc().format(pattern));
} else {
possible.push(d.local().format(pattern));
}
});

return resolve_indices(possible).then(function(p) {
Expand Down
9 changes: 9 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ function (Settings) {
*/
elasticsearch: "http://"+window.location.hostname+":9200",

/** @scratch /configuration/config.js/5
*
* ==== utc_tz
*
* A bool that declares if your index timestamps will be in UTC or local time. Use true for UTC and
* false for local time.
*/
utc_tz: true,

/** @scratch /configuration/config.js/5
*
* ==== default_route
Expand Down