Add policies signature history

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Jonathan
2025-05-27 12:32:04 +02:00
committed by Sacha Al Himdani
parent 2e6741942b
commit 61b1a24149
45 changed files with 1154 additions and 946 deletions

View File

@@ -50,26 +50,41 @@ export function TranslatorProvider({
export function useTranslate() {
const { translate, lang } = useContext(TranslatorContext);
const dateFormat = (
date: Date | string | null | undefined,
options: Intl.DateTimeFormatOptions = {
year: "numeric",
month: "short",
day: "numeric",
weekday: "short",
}
) => {
if (!date) {
return "";
}
if (typeof date === "string") {
return new Intl.DateTimeFormat(lang, options).format(parseDate(date));
}
return new Intl.DateTimeFormat(lang, options).format(date);
};
return {
lang,
__: translate,
dateFormat: (
dateFormat: dateFormat,
dateTimeFormat: (
date: Date | string | null | undefined,
options: Intl.DateTimeFormatOptions = {
year: "numeric",
month: "short",
hour: "2-digit",
hour12: false,
minute: "2-digit",
day: "numeric",
weekday: "short",
month: "short",
year: "numeric",
}
) => {
if (!date) {
return "";
}
if (typeof date === "string") {
return new Intl.DateTimeFormat(lang, options).format(parseDate(date));
}
return new Intl.DateTimeFormat(lang, options).format(date);
return dateFormat(date, options);
},
};
}