mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-14 15:17:55 +00:00
use current locale for Moment.js
This commit is contained in:
@@ -9,6 +9,7 @@ import moment from "moment";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Avatar } from "./avatar";
|
import { Avatar } from "./avatar";
|
||||||
|
import { useLocale } from "next-intl";
|
||||||
|
|
||||||
export function isSessionValid(session: Partial<Session>): {
|
export function isSessionValid(session: Partial<Session>): {
|
||||||
valid: boolean;
|
valid: boolean;
|
||||||
@@ -37,6 +38,9 @@ export function SessionItem({
|
|||||||
reload: () => void;
|
reload: () => void;
|
||||||
requestId?: string;
|
requestId?: string;
|
||||||
}) {
|
}) {
|
||||||
|
const currentLocale = useLocale();
|
||||||
|
moment.locale(currentLocale === "zh" ? "zh-cn" : currentLocale);
|
||||||
|
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
|
|
||||||
async function clearSession(id: string) {
|
async function clearSession(id: string) {
|
||||||
|
Reference in New Issue
Block a user