Added KOITO_DATE_FORMAT option to choose how the dates are displayed

This commit is contained in:
joffrey-b 2026-04-21 11:17:47 +02:00
parent 0ec7b458cc
commit 61d5f2f5f0
10 changed files with 53 additions and 9 deletions

View file

@ -9,6 +9,8 @@ import { useState } from "react";
import { useTheme } from "~/hooks/useTheme";
import ActivityOptsSelector from "./ActivityOptsSelector";
import type { Theme } from "~/styles/themes.css";
import { useAppContext } from "~/providers/AppProvider";
import { formatDate } from "~/utils/utils";
function getPrimaryColor(theme: Theme): string {
const value = theme.primary;
@ -65,6 +67,7 @@ export default function ActivityGrid({
const { theme } = useTheme();
const color = getPrimaryColor(theme);
const { dateFormat } = useAppContext();
if (isPending) {
return (
@ -165,7 +168,7 @@ export default function ActivityGrid({
position="top"
space={12}
extraClasses="left-2"
inner={`${new Date(item.start_time).toLocaleDateString()} ${
inner={`${formatDate(new Date(item.start_time), dateFormat)} ${
item.listens
} plays`}
>
@ -194,3 +197,4 @@ export default function ActivityGrid({
</div>
);
}