mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 07:35:09 +00:00
Fix: Format entire frontend properly
This commit is contained in:
@@ -15,7 +15,7 @@ const updateUserProjectPermission = async ({
|
||||
denials: {
|
||||
ability: string;
|
||||
environmentSlug: string;
|
||||
}[]
|
||||
}[];
|
||||
}) =>
|
||||
SecurityClient.fetchCall(`/api/v1/membership/${membershipId}/deny-permissions`, {
|
||||
method: "POST",
|
||||
|
||||
@@ -4,32 +4,30 @@
|
||||
* @returns {String} text - how much time has passed since a certain timestamp
|
||||
*/
|
||||
function timeSince(date: Date) {
|
||||
const seconds = Math.floor(
|
||||
((new Date() as any) - (date as any)) / 1000
|
||||
) as number;
|
||||
const seconds = Math.floor(((new Date() as any) - (date as any)) / 1000) as number;
|
||||
|
||||
let interval = seconds / 31536000;
|
||||
|
||||
if (interval > 1) {
|
||||
return `${Math.floor(interval) } years ago`;
|
||||
return `${Math.floor(interval)} years ago`;
|
||||
}
|
||||
interval = seconds / 2592000;
|
||||
if (interval > 1) {
|
||||
return `${Math.floor(interval) } months ago`;
|
||||
return `${Math.floor(interval)} months ago`;
|
||||
}
|
||||
interval = seconds / 86400;
|
||||
if (interval > 1) {
|
||||
return `${Math.floor(interval) } days ago`;
|
||||
return `${Math.floor(interval)} days ago`;
|
||||
}
|
||||
interval = seconds / 3600;
|
||||
if (interval > 1) {
|
||||
return `${Math.floor(interval) } hours ago`;
|
||||
return `${Math.floor(interval)} hours ago`;
|
||||
}
|
||||
interval = seconds / 60;
|
||||
if (interval > 1) {
|
||||
return `${Math.floor(interval) } minutes ago`;
|
||||
return `${Math.floor(interval)} minutes ago`;
|
||||
}
|
||||
return `${Math.floor(seconds) } seconds ago`;
|
||||
return `${Math.floor(seconds)} seconds ago`;
|
||||
}
|
||||
|
||||
export default timeSince;
|
||||
|
||||
Reference in New Issue
Block a user