From 3f88360cfd8a54e90420551a1442d79795e99b71 Mon Sep 17 00:00:00 2001
From: Piyush Kumar
Date: Sat, 16 Mar 2024 22:50:35 +0530
Subject: [PATCH] #4: Add Time stamp
---
frontend/package-lock.json | 14 ++++++++++++++
frontend/package.json | 1 +
frontend/src/components/TaskDetails.js | 5 ++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index dbd1123..5f415ea 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -12,6 +12,7 @@
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"date-fns": "^2.28.0",
+ "dateformat": "^5.0.3",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.3.0",
@@ -6049,6 +6050,14 @@
"url": "https://opencollective.com/date-fns"
}
},
+ "node_modules/dateformat": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-5.0.3.tgz",
+ "integrity": "sha512-Kvr6HmPXUMerlLcLF+Pwq3K7apHpYmGDVqrxcDasBg86UcKeTSNWbEzU8bwdXnxnR44FtMhJAxI4Bov6Y/KUfA==",
+ "engines": {
+ "node": ">=12.20"
+ }
+ },
"node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@@ -20713,6 +20722,11 @@
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.28.0.tgz",
"integrity": "sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw=="
},
+ "dateformat": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-5.0.3.tgz",
+ "integrity": "sha512-Kvr6HmPXUMerlLcLF+Pwq3K7apHpYmGDVqrxcDasBg86UcKeTSNWbEzU8bwdXnxnR44FtMhJAxI4Bov6Y/KUfA=="
+ },
"debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
diff --git a/frontend/package.json b/frontend/package.json
index 521f27b..5cccc97 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -8,6 +8,7 @@
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"date-fns": "^2.28.0",
+ "dateformat": "^5.0.3",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.3.0",
diff --git a/frontend/src/components/TaskDetails.js b/frontend/src/components/TaskDetails.js
index d7e208f..a59efa0 100644
--- a/frontend/src/components/TaskDetails.js
+++ b/frontend/src/components/TaskDetails.js
@@ -1,6 +1,6 @@
import { useTasksContext } from "../hooks/usetasksContext";
import { useAuthContext } from "../hooks/useAuthContext";
-
+import dateFormat from "dateformat";
const TaskDetails = ({ task }) => {
const { dispatch } = useTasksContext();
const { user } = useAuthContext();
@@ -35,6 +35,9 @@ const TaskDetails = ({ task }) => {
Progress:
{task.progress}
+
+ {dateFormat(task.createdAt,"longDate")}
+
delete