Skip to content

Commit

Permalink
refactor: move date conversion into item card
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-zeynal committed Nov 29, 2023
1 parent 23fb5e8 commit ee76438
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions frontend/src/components/item-card/item-card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/workshops/WorkshopsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit ee76438

Please sign in to comment.