Skip to content

Commit

Permalink
Forbid timezones not working in Elasticsearch (#70780)
Browse files Browse the repository at this point in the history
* Permit timezones not working in Elasticsearch

* Fix functional tests

* Use timezone without summer time for test

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
Tim Roes and elasticmachine authored Jul 7, 2020
1 parent f18002c commit aa99a70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/legacy/core_plugins/kibana/server/ui_setting_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ export function getUiSettingDefaults() {
},
}),
type: 'select',
options: ['Browser', ...moment.tz.names()],
options: [
'Browser',
...moment.tz
.names()
// We need to filter out some time zones, that moment.js knows about, but Elasticsearch
// does not understand and would fail thus with a 400 bad request when using them.
.filter((tz) => !['America/Nuuk', 'EST', 'HST', 'ROC', 'MST'].includes(tz)),
],
requiresPageReload: true,
},
'dateFormat:scaled': {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/apps/dashboard/time_zones.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function ({ getService, getPageObjects }) {
it('Changing timezone changes dashboard timestamp and shows the same data', async () => {
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaSettings();
await PageObjects.settings.setAdvancedSettingsSelect('dateFormat:tz', 'EST');
await PageObjects.settings.setAdvancedSettingsSelect('dateFormat:tz', 'Etc/GMT+5');
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.loadSavedDashboard('time zone test');
const time = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes();
Expand Down

0 comments on commit aa99a70

Please sign in to comment.