Skip to content

Commit db03580

Browse files
Tim Roeselasticmachine
authored andcommitted
Forbid timezones not working in Elasticsearch (#70780)
* Permit timezones not working in Elasticsearch * Fix functional tests * Use timezone without summer time for test Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent 2106819 commit db03580

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/legacy/core_plugins/kibana/server/ui_setting_defaults.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,14 @@ export function getUiSettingDefaults() {
101101
},
102102
}),
103103
type: 'select',
104-
options: ['Browser', ...moment.tz.names()],
104+
options: [
105+
'Browser',
106+
...moment.tz
107+
.names()
108+
// We need to filter out some time zones, that moment.js knows about, but Elasticsearch
109+
// does not understand and would fail thus with a 400 bad request when using them.
110+
.filter((tz) => !['America/Nuuk', 'EST', 'HST', 'ROC', 'MST'].includes(tz)),
111+
],
105112
requiresPageReload: true,
106113
},
107114
'dateFormat:scaled': {

test/functional/apps/dashboard/time_zones.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function ({ getService, getPageObjects }) {
6565
it('Changing timezone changes dashboard timestamp and shows the same data', async () => {
6666
await PageObjects.settings.navigateTo();
6767
await PageObjects.settings.clickKibanaSettings();
68-
await PageObjects.settings.setAdvancedSettingsSelect('dateFormat:tz', 'EST');
68+
await PageObjects.settings.setAdvancedSettingsSelect('dateFormat:tz', 'Etc/GMT+5');
6969
await PageObjects.common.navigateToApp('dashboard');
7070
await PageObjects.dashboard.loadSavedDashboard('time zone test');
7171
const time = await PageObjects.timePicker.getTimeConfigAsAbsoluteTimes();

0 commit comments

Comments
 (0)