@@ -2,8 +2,15 @@ import Link from '@docusaurus/Link';
22import { getReleaseBranches } from '../RabbitMQServerReleaseInfo' ;
33import 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
815function 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" >
0 commit comments