diff --git a/frontend/sportsmatch-app/src/components/RateGameComponent.tsx b/frontend/sportsmatch-app/src/components/RateGameComponent.tsx index 6943cdd..acc988e 100644 --- a/frontend/sportsmatch-app/src/components/RateGameComponent.tsx +++ b/frontend/sportsmatch-app/src/components/RateGameComponent.tsx @@ -53,21 +53,6 @@ export default function RateGameComponent(p: Props) { init() }, []) - const dayOfTheWeek = (year: number, month: number, day: number) => { - const daysOfTheWeek = [ - 'Sunday', - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday', - 'Saturday', - ] - const date = new Date(year, month - 1, day) - const dateIndex = date.getDay() - return daysOfTheWeek[dateIndex] - } - const userProfilePicture = 'pictures/unknown-user-placeholder.png' const opponentProfilePicture = 'pictures/unknown-user-placeholder.png' @@ -106,6 +91,18 @@ export default function RateGameComponent(p: Props) { const value = parseInt(e.target.value) || 0 setOpponentScore(value) } + + const getDateAndTime = (type: string, date: string) => { + const dateStart: string[] = date.split(' ') + if (type === 'date') { + return dateStart[0] + } else if (type === 'time') { + return dateStart[1] + } else { + return null + } + } + return ( <>