Thanks @Marco_Liberati for the reply.
I tried making changes to the lib folder but in vain.
Let me explain my problem further and the steps I follow to make changes.
I downloaded the production build of Elasticsearch and Kibana (version 7.15.1), running them locally using the commands bin\Elasticsearch.bat and bin\kibana.bat respectively.
I want to make some customization to the Kibana date time filter(EUI Super Date Picker) according to the need of my company. The specific changes I made : -
- node_modules@elastic\eui\lib\components\date_picker\super_date_picker\relativeOptions.js
var relativeOptions = [{
text: 'Seconds ago',
value: 's'
}, {
text: 'Minutes ago',
value: 'm'
}, {
text: 'Hours ago',
value: 'h'
}, {
text: 'Days ago',
value: 'd'
}, {
text: 'Weeks ago',
value: 'w'
}, {
text: 'Months ago',
value: 'M'
},
// Commented this code
// {
// text: 'Years ago',
// value: 'y'
// },
{
text: 'Seconds from now',
value: 's+'
}, {
text: 'Minutes from now',
value: 'm+'
}, {
text: 'Hours from now',
value: 'h+'
}, {
text: 'Days from now',
value: 'd+'
}, {
text: 'Weeks from now',
value: 'w+'
}, {
text: 'Months from now',
value: 'M+'
},
// Commented this code
// {
// text: 'Years from now',
// value: 'y+'
// }
];
- node_modules@elastic\eui\lib\components\date_picker\super_date_picker\super_date_picker.js
function isRangeInvalid(start, end) {
if (start === 'now' && end === 'now') {
return true;
}
var startMoment = _datemath.default.parse(start);
var endMoment = _datemath.default.parse(end, {
roundUp: true
});
if (!startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid()) {
return true;
}
if (startMoment.isAfter(endMoment)) {
return true;
}
// Added this code
if(endMoment.diff(startMoment, "days") > 365) {
return true
}
return false;
}
After making these changes, I re-run Elasticsearch and Kibana but changes are not reflected in the Kibana GUI. I don't know whether I'm making some mistakes or missing some steps. Please help me out on this. Thanks in advance.