[8.8] [ResponseOps] [Maintenance Windows] Fix date format on the table (#156857) (#157743)

# Backport

This will backport the following commits from `main` to `8.8`:
- [[ResponseOps] [Maintenance Windows] Fix date format on the table
(#156857)](https://github.com/elastic/kibana/pull/156857)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alexi
Doak","email":"109488926+doakalexi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-05-15T14:53:31Z","message":"[ResponseOps]
[Maintenance Windows] Fix date format on the table (#156857)\n\nResolves
https://github.com/elastic/kibana/issues/156852\r\n\r\n##
Summary\r\n\r\nRemoves 24-clock date formatting\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"d4877dc5f25280909755542af72cea02e8a8343f","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v8.8.0","v8.9.0"],"number":156857,"url":"https://github.com/elastic/kibana/pull/156857","mergeCommit":{"message":"[ResponseOps]
[Maintenance Windows] Fix date format on the table (#156857)\n\nResolves
https://github.com/elastic/kibana/issues/156852\r\n\r\n##
Summary\r\n\r\nRemoves 24-clock date formatting\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"d4877dc5f25280909755542af72cea02e8a8343f"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156857","number":156857,"mergeCommit":{"message":"[ResponseOps]
[Maintenance Windows] Fix date format on the table (#156857)\n\nResolves
https://github.com/elastic/kibana/issues/156852\r\n\r\n##
Summary\r\n\r\nRemoves 24-clock date formatting\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"d4877dc5f25280909755542af72cea02e8a8343f"}}]}]
BACKPORT-->

Co-authored-by: Alexi Doak <109488926+doakalexi@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2023-05-15 13:04:49 -04:00 committed by GitHub
parent 76b43a71df
commit 59064c3e4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -116,10 +116,10 @@ describe('MaintenanceWindowsList', () => {
expect(result.getAllByText('Archived')).toHaveLength(1);
// check the startDate formatting
expect(result.getAllByText('04/05/23 00:00 AM')).toHaveLength(4);
expect(result.getAllByText('04/05/23 12:00 AM')).toHaveLength(4);
// check the endDate formatting
expect(result.getAllByText('05/05/23 00:00 AM')).toHaveLength(4);
expect(result.getAllByText('05/05/23 12:00 AM')).toHaveLength(4);
// check if action menu is there
expect(result.getAllByTestId('table-actions-icon-button')).toHaveLength(items.length);

View file

@ -60,7 +60,7 @@ const COLUMNS: Array<EuiBasicTableColumn<MaintenanceWindowFindResponse>> = [
render: (startDate: string, item: MaintenanceWindowFindResponse) => {
return (
<EuiFlexGroup responsive={false} alignItems="center">
<EuiFlexItem grow={false}>{formatDate(startDate, 'MM/DD/YY HH:mm A')}</EuiFlexItem>
<EuiFlexItem grow={false}>{formatDate(startDate, 'MM/DD/YY hh:mm A')}</EuiFlexItem>
{item.events.length > 1 ? (
<EuiFlexItem grow={false}>
<UpcomingEventsPopover maintenanceWindowFindResponse={item} />
@ -75,7 +75,7 @@ const COLUMNS: Array<EuiBasicTableColumn<MaintenanceWindowFindResponse>> = [
field: 'eventEndTime',
name: i18n.TABLE_END_TIME,
dataType: 'date',
render: (endDate: string) => formatDate(endDate, 'MM/DD/YY HH:mm A'),
render: (endDate: string) => formatDate(endDate, 'MM/DD/YY hh:mm A'),
},
];

View file

@ -107,7 +107,7 @@ export const UpcomingEventsPopover: React.FC<UpcomingEventsPopoverProps> = React
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText color="subdued" size="s">
{formatDate(event.gte, 'MM/DD/YY HH:mm A')}
{formatDate(event.gte, 'MM/DD/YY hh:mm A')}
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>