Skip to content

Commit

Permalink
Added button to EuiSuperDatePicker's “Now” tab to trigger the "now"…
Browse files Browse the repository at this point in the history
… time selection (elastic#1620)
  • Loading branch information
cchaos authored and chandlerprall committed Mar 14, 2019
1 parent 68f8592 commit af436ef
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

**Note: this release is a backport containing changes originally made in `9.0.0`, `9.1.0`, and `9.4.0`**

- Adjusted the dark theme palette to have a slight blue titn ([#1691](https://github.com/elastic/eui/pull/1691))
- Adjusted the dark theme palette to have a slight blue tint ([#1691](https://github.com/elastic/eui/pull/1691))
- Added button to `EuiSuperDatePicker`'s “Now” tab to trigger the "now" time selection ([#1620](https://github.com/elastic/eui/pull/1620))

**Bug fixes**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
.euiDatePopoverContent__padded {
padding: $euiSizeS;
}

.euiDatePopoverContent__padded--large {
padding: $euiSize;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';

import { EuiTabbedContent } from '../../../tabs';
import { EuiText } from '../../../text';
import { EuiButton } from '../../../button';

import { EuiAbsoluteTab } from './absolute_tab';
import { EuiRelativeTab } from './relative_tab';
Expand All @@ -25,9 +26,6 @@ export function EuiDatePopoverContent({ value, roundUp, onChange, dateFormat })
case DATE_MODES.RELATIVE:
onChange(toRelativeString(value));
break;
case DATE_MODES.NOW:
onChange('now');
break;
}
};

Expand Down Expand Up @@ -62,11 +60,20 @@ export function EuiDatePopoverContent({ value, roundUp, onChange, dateFormat })
id: DATE_MODES.NOW,
name: 'Now',
content: (
<EuiText size="s" color="subdued" className="euiDatePopoverContent__padded">
<EuiText size="s" color="subdued" className="euiDatePopoverContent__padded--large">
<p>
Setting the time to &quot;Now&quot; means that on every refresh
Setting the time to &quot;now&quot; means that on every refresh
this time will be set to the time of the refresh.
</p>
<EuiButton
data-test-subj="superDatePickerNowButton"
onClick={() => onChange('now')}
fullWidth
size="s"
fill
>
Set date and time to now
</EuiButton>
</EuiText>
),
'data-test-subj': 'superDatePickerNowTab',
Expand Down

0 comments on commit af436ef

Please sign in to comment.