From ee76438e3268d5c1e6eac2310642f93b47dbfc7d Mon Sep 17 00:00:00 2001 From: mh-zeynal Date: Wed, 29 Nov 2023 14:53:42 +0330 Subject: [PATCH] refactor: move date conversion into item card --- frontend/src/components/item-card/item-card.jsx | 6 +++--- frontend/src/pages/workshops/WorkshopsPage.jsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/item-card/item-card.jsx b/frontend/src/components/item-card/item-card.jsx index 2582c12..b58b189 100644 --- a/frontend/src/components/item-card/item-card.jsx +++ b/frontend/src/components/item-card/item-card.jsx @@ -59,7 +59,7 @@ const ItemCard = ({ level, cost = 50000, purchaseState = 0, // 0 -> not purchased, 1 -> in cart, 2 -> purchased - hasProject = true, + hasProject = false, prerequisites, syllabus, remainingCapacity = 50, @@ -180,8 +180,8 @@ ItemCard.propTypes = { title: PropTypes.string, isWorkshop: PropTypes.bool, description: PropTypes.string, - startDate: PropTypes.string, - endDate: PropTypes.string, + startDate: PropTypes.number, + endDate: PropTypes.number, presenterName: PropTypes.string, level: PropTypes.string, cost: PropTypes.number, diff --git a/frontend/src/pages/workshops/WorkshopsPage.jsx b/frontend/src/pages/workshops/WorkshopsPage.jsx index 9a65d73..0a65d1f 100644 --- a/frontend/src/pages/workshops/WorkshopsPage.jsx +++ b/frontend/src/pages/workshops/WorkshopsPage.jsx @@ -46,8 +46,8 @@ export default function WorkshopsPage() { remainingCapacity={item.remaining_capacity} purchaseState={0} presenterName={item.presenters.join(', ')} - startDate={new Date(item.start_date).toLocaleString()} - endDate={new Date(item.end_date).toLocaleString()} + startDate={item.start_date} + endDate={item.end_date} level={item.level} capacity={item.capacity} cost={item.cost}