mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: profile time according to the user timezone (#2089)
This commit is contained in:
parent
19c65b26d6
commit
900a4fcb0e
@ -14,7 +14,7 @@ import { Icon, Loader, Tooltip } from "components/ui";
|
|||||||
// icons
|
// icons
|
||||||
import { EditOutlined } from "@mui/icons-material";
|
import { EditOutlined } from "@mui/icons-material";
|
||||||
// helpers
|
// helpers
|
||||||
import { render12HourFormatTime, renderLongDetailDateFormat } from "helpers/date-time.helper";
|
import { renderLongDetailDateFormat } from "helpers/date-time.helper";
|
||||||
import { renderEmoji } from "helpers/emoji.helper";
|
import { renderEmoji } from "helpers/emoji.helper";
|
||||||
// fetch-keys
|
// fetch-keys
|
||||||
import { USER_PROFILE_PROJECT_SEGREGATION } from "constants/fetch-keys";
|
import { USER_PROFILE_PROJECT_SEGREGATION } from "constants/fetch-keys";
|
||||||
@ -35,6 +35,16 @@ export const ProfileSidebar = () => {
|
|||||||
: null
|
: null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Create a date object for the current time in the specified timezone
|
||||||
|
const currentTime = new Date();
|
||||||
|
const formatter = new Intl.DateTimeFormat("en-US", {
|
||||||
|
timeZone: userProjectsData?.user_data.user_timezone,
|
||||||
|
hour12: false, // Use 24-hour format
|
||||||
|
hour: "2-digit",
|
||||||
|
minute: "2-digit",
|
||||||
|
});
|
||||||
|
const timeString = formatter.format(currentTime);
|
||||||
|
|
||||||
const userDetails = [
|
const userDetails = [
|
||||||
{
|
{
|
||||||
label: "Joined on",
|
label: "Joined on",
|
||||||
@ -44,7 +54,7 @@ export const ProfileSidebar = () => {
|
|||||||
label: "Timezone",
|
label: "Timezone",
|
||||||
value: (
|
value: (
|
||||||
<span>
|
<span>
|
||||||
{render12HourFormatTime(new Date())}{" "}
|
{timeString}{" "}
|
||||||
<span className="text-custom-text-200">{userProjectsData?.user_data.user_timezone}</span>
|
<span className="text-custom-text-200">{userProjectsData?.user_data.user_timezone}</span>
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user