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

Inherit commonly used data on relative tab on EuiSuperDatePicker #3106

Merged
merged 6 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

**Bug Fixes**

- Fixed bug in `EuiSuperDatePicker` to show correct values of commonly used values in relative tab ([#3106](https://github.com/elastic/eui/pull/3106))
ashikmeerankutty marked this conversation as resolved.
Show resolved Hide resolved
- Fixed `EuiFieldNumber` so values of type `number` are now allowed ([#3020](https://github.com/elastic/eui/pull/3020))
- Fixed SASS `contrastRatio()` function in dark mode by fixing the `pow()` math function ([#3013], (https://github.com/elastic/eui/pull/3013))
- Fixed bug preventing `EuiDataGrid` from re-evaluating the default column width on resize ([#2991](https://github.com/elastic/eui/pull/2991))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ export function parseRelativeParts(value) {
isString(value) &&
value.match(/now(([\-\+])([0-9]+)([smhdwMy])(\/[smhdwMy])?)?/);

const isNow = matches && !matches[1];
const operator = matches && matches[2];
const count = matches && matches[3];
const unit = matches && matches[4];
const roundBy = matches && matches[5];

if (isNow) {
return { count: 0, unit: 's', round: false };
}

if (count && unit) {
const isRounded = roundBy ? true : false;
return {
Expand Down