feat: Add date formatting utility functions and integrate them across components

This commit is contained in:
Chop
2025-06-19 23:29:06 +02:00
parent 306c96328e
commit 639179ed21
11 changed files with 118 additions and 74 deletions

View File

@@ -6,6 +6,7 @@ import TaskStatusDropdownSimple from "./TaskStatusDropdownSimple";
import { Card, CardHeader, CardContent } from "./ui/Card";
import Button from "./ui/Button";
import Badge from "./ui/Badge";
import { formatDate } from "@/lib/utils";
export default function ProjectTasksSection({ projectId }) {
const [projectTasks, setProjectTasks] = useState([]);
@@ -444,7 +445,7 @@ export default function ProjectTasksSection({ projectId }) {
</td>{" "}
<td className="px-4 py-4 text-sm text-gray-600">
{task.date_started
? new Date(task.date_started).toLocaleDateString()
? formatDate(task.date_started)
: "Not started"}
</td>{" "}
<td className="px-4 py-4">
@@ -519,15 +520,11 @@ export default function ProjectTasksSection({ projectId }) {
</div>
<p className="text-sm text-gray-800">
{note.note}
</p>
</p>{" "}
<p className="text-xs text-gray-500 mt-1">
{new Date(
note.note_date
).toLocaleDateString()}{" "}
at{" "}
{new Date(
note.note_date
).toLocaleTimeString()}
{formatDate(note.note_date, {
includeTime: true,
})}
</p>
</div>
{!note.is_system && (