Skip to content

Commit 9933ce6

Browse files
committed
[RMQ-2183] Fix format and adjust support timeline styles
1 parent 67ccc0d commit 9933ce6

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/components/CommercialSupportTimelines/index.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ import Link from '@docusaurus/Link';
22
import {getReleaseBranches} from '../RabbitMQServerReleaseInfo';
33
import styles from "./index.module.css"
44

5-
const releaseDateOptions = { year: 'numeric', month: 'short' };
6-
const dateOptions = { year: 'numeric', month: 'short', day: 'numeric' };
5+
function formatDate(date, isReleaseDate) {
6+
const year = date.toLocaleDateString("en-US", { year: "numeric" });
7+
const month = date.toLocaleDateString("en-US", { month: "short" });
8+
if (isReleaseDate) {
9+
return `${month} ${year}`;
10+
}
11+
const day = date.toLocaleDateString("en-US", { day: "numeric" });
12+
return `${day} ${month} ${year}`;
13+
}
714

815
function getTimelineRows(releaseBranches) {
916
const now = Date.now();
@@ -36,12 +43,12 @@ function getTimelineRows(releaseBranches) {
3643
const endOfCommunitySupport =
3744
endOfCommunitySupportDate === undefined
3845
? 'Next Release'
39-
: endOfCommunitySupportDate.toLocaleDateString('en-GB', dateOptions);
40-
const endOfCommercialSupport = endOfCommercialSupportDate.toLocaleDateString("en-GB", dateOptions);
46+
: formatDate(endOfCommunitySupportDate, false);
47+
const endOfCommercialSupport = formatDate(endOfCommercialSupportDate, false);
4148

4249
rows.push({
4350
release: branch,
44-
releaseDate: releaseDate.toLocaleDateString("en-GB", releaseDateOptions),
51+
releaseDate: formatDate(releaseDate, true),
4552
endOfCommunitySupport,
4653
endOfCommercialSupport,
4754
isCommunitySupported,
@@ -58,7 +65,6 @@ export function CommercialSupportTimelines() {
5865
const releaseBranches = getReleaseBranches();
5966

6067
const rows = getTimelineRows(releaseBranches);
61-
console.log(rows)
6268

6369
return (
6470
<div className="release-information">

src/components/CommercialSupportTimelines/index.module.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
}
55

66
.timelines_table td, .timelines_table th {
7+
text-align: center;
78
padding: calc(var(--ifm-table-cell-padding) / 2) var(--ifm-table-cell-padding);
89
}
910

11+
.timelines_table td:not(:first-child) {
12+
width: 28%;
13+
}
14+
1015
.supported {
1116
background-color: var(--ri-color-latest);
1217
}

0 commit comments

Comments
 (0)