Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix staff expiry status rendering

Manav Rathi9d841485b029
diff --git a/infra/staff/src/App.tsx b/infra/staff/src/App.tsx
index d879e8d73b..5cac5b00ee 100644
--- a/infra/staff/src/App.tsx
+++ b/infra/staff/src/App.tsx
@@ -122,7 +122,7 @@ const App: React.FC = () => {
"Expiry time":
new Date(
userDataResponse.subscription.expiryTime / 1000,
- ).toLocaleString() || "None",
+ ).toISOString() || "None",
},
security: {
"Email MFA": userDataResponse.details?.profileData
diff --git a/infra/staff/src/components/UserComponent.tsx b/infra/staff/src/components/UserComponent.tsx
index 3e2bb7fbbe..82c21833ba 100644
--- a/infra/staff/src/components/UserComponent.tsx
+++ b/infra/staff/src/components/UserComponent.tsx
@@ -350,22 +350,20 @@ const renderTableCellContent = (
)}
</Box>
);
- // If Expirty time (in format 30/1/2026, 11:12:53 am) is greatheer than current date, show it in bold green
case "Expiry time": {
- const expiryTime = new Date(
- Date.parse(
- value.replace(
- /(\d+)\/(\d+)\/(\d+), (\d+:\d+:\d+ \w+)/,
- "$2/$1/$3 $4",
- ),
- ),
- );
+ const expiryTime = new Date(value);
const currentTime = new Date();
+ const isValidExpiryTime = !Number.isNaN(expiryTime.getTime());
return (
<Typography
- sx={{ color: expiryTime > currentTime ? "#00B33C" : "red" }}
+ sx={{
+ color:
+ isValidExpiryTime && expiryTime > currentTime
+ ? "#00B33C"
+ : "red",
+ }}
>
- {value}
+ {isValidExpiryTime ? expiryTime.toLocaleString() : value}
</Typography>
);
}