i18n: translate dayjs date
All checks were successful
/ Build (push) Successful in 37s

This commit is contained in:
log101 2024-09-03 10:08:59 +03:00
parent 6188e0012a
commit 5445f62e2e

View File

@ -116,6 +116,7 @@ import { CalendarIcon } from "@radix-ui/react-icons"
import dayjs from "dayjs"
import relativeTime from "dayjs/plugin/relativeTime"
import utc from "dayjs/plugin/utc"
import "dayjs/locale/tr"
// Map
import { initMap } from "@/scripts/initMap"
@ -132,10 +133,11 @@ import { CalendarIcon } from "@radix-ui/react-icons"
const data: Content | null = res.status === 200 ? await res.json() : null
dayjs.extend(relativeTime)
dayjs.extend(utc)
dayjs.locale("tr")
const dateFromNow = dayjs.utc(data?.created_at).from(dayjs.utc())
console.log(dateFromNow)
updateText("card-title", data?.author ?? "")
updateText("card-description", data?.description ?? "")