From 02ede704fe057e882766934e45dc48032b6f3b0e Mon Sep 17 00:00:00 2001 From: npiyush97 Date: Mon, 19 Jun 2023 16:46:47 +0530 Subject: [PATCH 1/4] fix-18259 Signed-off-by: npiyush97 --- plugins/sonarqube/package.json | 3 ++- .../src/components/SonarQubeCard/SonarQubeCard.tsx | 13 ++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/plugins/sonarqube/package.json b/plugins/sonarqube/package.json index 5042b6ba77..ad5cca37aa 100644 --- a/plugins/sonarqube/package.json +++ b/plugins/sonarqube/package.json @@ -47,7 +47,8 @@ "@material-ui/styles": "^4.10.0", "cross-fetch": "^3.1.5", "rc-progress": "3.4.1", - "react-use": "^17.2.4" + "react-use": "^17.2.4", + "luxon": "^3.3.0" }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0", diff --git a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx index 932641e48d..7ad4717bd2 100644 --- a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx +++ b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx @@ -42,6 +42,7 @@ import { Progress, } from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; +import { DateTime } from 'luxon'; const useStyles = makeStyles(theme => ({ badgeLabel: { @@ -272,15 +273,9 @@ export const SonarQubeCard = (props: { Last analyzed on{' '} - {new Date(value.lastAnalysis).toLocaleString('en-US', { - timeZone: 'UTC', - day: 'numeric', - month: 'short', - year: 'numeric', - hour: '2-digit', - minute: '2-digit', - hour12: false, - })} + {DateTime.fromISO(value.lastAnalysis).toLocaleString( + DateTime.DATETIME_MED, + )} From 1108f1c65d3100fd646ebebe35ee5aa18024fdd2 Mon Sep 17 00:00:00 2001 From: npiyush97 Date: Mon, 19 Jun 2023 16:49:12 +0530 Subject: [PATCH 2/4] fix-18259 Signed-off-by: npiyush97 --- .changeset/mighty-panthers-itch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/mighty-panthers-itch.md diff --git a/.changeset/mighty-panthers-itch.md b/.changeset/mighty-panthers-itch.md new file mode 100644 index 0000000000..f360500a1d --- /dev/null +++ b/.changeset/mighty-panthers-itch.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-sonarqube': minor +--- + +fixed issued related #18259 now using luxon as adr102 asked From a2e49115582c200da6512846000ff2e26437ba56 Mon Sep 17 00:00:00 2001 From: PIYUSH NEGI <43876655+npiyush97@users.noreply.github.com> Date: Mon, 19 Jun 2023 16:51:04 +0530 Subject: [PATCH 3/4] Update mighty-panthers-itch.md Signed-off-by: PIYUSH NEGI <43876655+npiyush97@users.noreply.github.com> --- .changeset/mighty-panthers-itch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/mighty-panthers-itch.md b/.changeset/mighty-panthers-itch.md index f360500a1d..35d7d3d1f2 100644 --- a/.changeset/mighty-panthers-itch.md +++ b/.changeset/mighty-panthers-itch.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-sonarqube': minor +'@backstage/plugin-sonarqube': patch --- fixed issued related #18259 now using luxon as adr102 asked From 91c2df59debc4844ccae3b8f3403041c28b3edd1 Mon Sep 17 00:00:00 2001 From: npiyush97 Date: Mon, 19 Jun 2023 17:17:42 +0530 Subject: [PATCH 4/4] added suggested changes Signed-off-by: npiyush97 --- plugins/sonarqube/package.json | 4 ++-- yarn.lock | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/sonarqube/package.json b/plugins/sonarqube/package.json index ad5cca37aa..503c275efe 100644 --- a/plugins/sonarqube/package.json +++ b/plugins/sonarqube/package.json @@ -46,9 +46,9 @@ "@material-ui/lab": "4.0.0-alpha.61", "@material-ui/styles": "^4.10.0", "cross-fetch": "^3.1.5", + "luxon": "^3.0.0", "rc-progress": "3.4.1", - "react-use": "^17.2.4", - "luxon": "^3.3.0" + "react-use": "^17.2.4" }, "peerDependencies": { "react": "^16.13.1 || ^17.0.0", diff --git a/yarn.lock b/yarn.lock index 468a6aa431..55332fe496 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9199,6 +9199,7 @@ __metadata: "@types/node": ^16.11.26 "@types/react": ^16.13.1 || ^17.0.0 cross-fetch: ^3.1.5 + luxon: ^3.0.0 msw: ^1.0.0 rc-progress: 3.4.1 react-use: ^17.2.4