1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-19 17:52:45 +02:00

Fix: use locale string for change request time badge. (#10651)

Uses the user's preferred date / time formatting for the scheduled at
time in CR schedule badges.

Before (en-US formatting):
<img width="291" height="58" alt="image"
src="https://github.com/user-attachments/assets/edb04292-4678-4bfd-93a1-8fd2a3f01a1f"
/>

After (ja formatting):
<img width="308" height="106" alt="image"
src="https://github.com/user-attachments/assets/9828355f-0c23-4b8f-bef3-a0173e92c306"
/>
This commit is contained in:
Thomas Heartman 2025-09-11 09:13:26 +02:00 committed by GitHub
parent 74f7a3bb85
commit d3e7e67b91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ import Close from '@mui/icons-material/Close';
import ErrorIcon from '@mui/icons-material/Error'; import ErrorIcon from '@mui/icons-material/Error';
import PauseCircle from '@mui/icons-material/PauseCircle'; import PauseCircle from '@mui/icons-material/PauseCircle';
import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip'; import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip';
import { useLocationSettings } from 'hooks/useLocationSettings';
interface IChangeRequestStatusBadgeProps { interface IChangeRequestStatusBadgeProps {
changeRequest: ChangeRequestType | undefined; changeRequest: ChangeRequestType | undefined;
@ -59,7 +60,10 @@ export const ChangeRequestStatusBadge: VFC<IChangeRequestStatusBadgeProps> = ({
); );
case 'Scheduled': { case 'Scheduled': {
const { schedule } = changeRequest; const { schedule } = changeRequest;
const scheduledAt = new Date(schedule.scheduledAt).toLocaleString(); const { locationSettings } = useLocationSettings();
const scheduledAt = new Date(schedule.scheduledAt).toLocaleString(
locationSettings.locale,
);
const { color, icon, tooltipTitle } = (() => { const { color, icon, tooltipTitle } = (() => {
switch (schedule.status) { switch (schedule.status) {