diff --git a/components/shared/datatables/task/task-table.tsx b/components/shared/datatables/task/task-table.tsx index 806c3a9..5b15777 100644 --- a/components/shared/datatables/task/task-table.tsx +++ b/components/shared/datatables/task/task-table.tsx @@ -40,6 +40,7 @@ import { import Link from "next/link" import { Task } from "@/types/task/model" import { sanitizeInput } from "@/utils/regex"; +import { formatToTurkeyTime } from "@/lib/utils"; @@ -90,12 +91,16 @@ export const columns: ColumnDef[] = [ { accessorKey: "description", header: "Description", - cell: ({ row }) =>
{row.getValue("description")}
, + cell: ({ row }) => { + const description = row.getValue("description"); + return
{typeof description === "string" ? description.slice(0, 12)+'..' : ""}
; + }, }, + { accessorKey: "dueDate", header: "Due Date", - cell: ({ row }) =>
{row.getValue("dueDate")}
, + cell: ({ row }) =>
{formatToTurkeyTime(row.getValue("dueDate"))}
, }, { accessorKey: "status", @@ -217,7 +222,7 @@ const TaskTable: React.FC = ({ data }) => {
diff --git a/lib/utils.ts b/lib/utils.ts index bd0c391..de83e0e 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -4,3 +4,18 @@ import { twMerge } from "tailwind-merge" export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } + + + +export function formatToTurkeyTime(dateString: string) { + const date = new Date(dateString); // Tarihi oluştur + return date.toLocaleString("tr-TR", { + timeZone: "Europe/Istanbul", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }); +} \ No newline at end of file