Web: Client: fix getting dates in portal language format instead of user language in info panel

This commit is contained in:
Aleksandr Lushkin 2023-09-04 13:50:30 +02:00
parent 21f8f74f47
commit 69165ea30f

View File

@ -15,6 +15,7 @@ import {
getFileTypeName,
} from "@docspace/client/src/helpers/filesUtils";
import CommentEditor from "../sub-components/CommentEditor";
import { getCookie } from "@docspace/common/utils";
// Property Content Components
@ -58,7 +59,7 @@ export const decodeString = (str) => {
};
export const parseAndFormatDate = (date, personal, culture) => {
const locale = personal ? localStorage.getItem(LANGUAGE) : culture;
const locale = getCookie(LANGUAGE) || culture;
const correctDate = getCorrectDate(locale, date);
return correctDate;
};
@ -119,39 +120,40 @@ class DetailsHelper {
};
getNeededProperties = () => {
return (this.item.isRoom
? [
"Owner",
this.item.providerKey && "Storage Type",
"Type",
"Content",
"Date modified",
"Last modified by",
"Creation date",
this.item.tags.length && "Tags",
]
: this.item.isFolder
? [
"Owner",
//"Location",
"Type",
"Content",
"Date modified",
"Last modified by",
"Creation date",
]
: [
"Owner",
//"Location",
"Type",
"File extension",
"Size",
"Date modified",
"Last modified by",
"Creation date",
"Versions",
"Comments",
]
return (
this.item.isRoom
? [
"Owner",
this.item.providerKey && "Storage Type",
"Type",
"Content",
"Date modified",
"Last modified by",
"Creation date",
this.item.tags.length && "Tags",
]
: this.item.isFolder
? [
"Owner",
//"Location",
"Type",
"Content",
"Date modified",
"Last modified by",
"Creation date",
]
: [
"Owner",
//"Location",
"Type",
"File extension",
"Size",
"Date modified",
"Last modified by",
"Creation date",
"Versions",
"Comments",
]
).filter((nP) => !!nP);
};