Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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))
- Fixed race condition in `EuiIcon` when switching from dynamically fetched components ([#3118](https://github.com/elastic/eui/pull/3118))

## [`21.1.0`](https://github.com/elastic/eui/tree/v21.1.0)
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