Skip to content

Commit

Permalink
improved the date dispaly
Browse files Browse the repository at this point in the history
  • Loading branch information
vedang8 committed Mar 9, 2024
1 parent d10d071 commit 4cbfa63
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Binary file added client/src/images/carbontrading.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions client/src/pages/Admin/SellCredits.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ function SellCredits() {
const { status, _id } = record;
return (
<div className="flex gap-5">
{status === "Pending" && (
{status === "pending" && (
<span
className="underline cursor-pointer"
onClick={() => onStatusUpdate(_id, "Approved")}
>
Approve
</span>
)}
{status === "Pending" && (
{status === "pending" && (
<span
className="underline cursor-pointer"
onClick={() => onStatusUpdate(_id, "Rejected")}
Expand Down
10 changes: 10 additions & 0 deletions client/src/pages/CarbonCredits/Credits.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,20 @@ function Credits() {
{
title: "Start Date",
dataIndex: "startDate",
render: (record) => {
return (
<span>{new Date(record).toLocaleDateString()}</span>
);
}
},
{
title: "End Date",
dataIndex: "endDate",
render: (record) => {
return (
<span>{new Date(record).toLocaleDateString()}</span>
);
}
},
{
title: "Baseline Emission Amt",
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Home = () => {
const [credits, setCredits] = useState([]);
const [forms, setForms] = useState([]);
const [filters, setFilters] = useState({
status: "approved",
status: "Approved",
});
const dispatch = useDispatch();
const navigate = useNavigate();
Expand Down Expand Up @@ -57,7 +57,7 @@ const Home = () => {
<div>
<div className="grid grid-cols-5 gap-2">
{forms
.filter((form) => form.status === "approved")
.filter((form) => form.status === "Approved")
.map((form) => {
return (
<div className="border border-gray-300 rounded border-solid flex flex-col gap-5 pb-2 cursor-pointer"
Expand Down

0 comments on commit 4cbfa63

Please sign in to comment.