/
githubmirror
/
Open-Assistant
Обзор
Документация
Войти
/
githubmirror
/
Open-Assistant
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
website/src/components/Messages/MessageCreateDate.tsx
19 строк
651 B
someone13574
Edit history viewer (#3322)
09 июн 2023, 16:01
Не верифицирован
09 июн 2023, 16:01
c0edd79
Код
Авторство
О чём код?
import { Text, useColorModeValue } from "@chakra-ui/react"; import { useCurrentLocale } from "src/hooks/locale/useCurrentLocale"; export const MessageCreateDate = ({ date }: { date: string }) => { const locale = useCurrentLocale(); const createdDateColor = useColorModeValue("blackAlpha.600", "gray.400"); return ( <Text as="span" fontSize="small" color={createdDateColor} fontWeight="medium" me={{ base: 3, md: 6 }}> {new Intl.DateTimeFormat(locale, { hour: "2-digit", minute: "2-digit", year: "numeric", month: "2-digit", day: "2-digit", }).format(new Date(date))} </Text> ); };