diff --git a/backend/sportsmatch/src/main/java/com/sportsmatch/dtos/EventDTO.java b/backend/sportsmatch/src/main/java/com/sportsmatch/dtos/EventDTO.java
index 7309ddb0..0c07c554 100644
--- a/backend/sportsmatch/src/main/java/com/sportsmatch/dtos/EventDTO.java
+++ b/backend/sportsmatch/src/main/java/com/sportsmatch/dtos/EventDTO.java
@@ -1,5 +1,6 @@
package com.sportsmatch.dtos;
+import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.*;
@@ -16,8 +17,10 @@ public class EventDTO {
private Long id;
@NotNull
+ @JsonFormat(pattern = "dd-MM-yyyy HH:mm")
private LocalDateTime dateStart;
@NotNull
+ @JsonFormat(pattern = "dd-MM-yyyy HH:mm")
private LocalDateTime dateEnd;
@NotNull
private Integer minElo;
diff --git a/frontend/sportsmatch-app/src/components/SportEvent.test.tsx b/frontend/sportsmatch-app/src/components/SportEvent.test.tsx
index cc2db07a..39239d16 100644
--- a/frontend/sportsmatch-app/src/components/SportEvent.test.tsx
+++ b/frontend/sportsmatch-app/src/components/SportEvent.test.tsx
@@ -7,8 +7,8 @@ describe('SportEvent', async () => {
id: 1,
maxElo: 2000,
minElo: 1800,
- dateEnd: [2024, 9, 20, 17, 0],
- dateStart: [2024, 9, 20, 15, 0],
+ dateEnd: '27-01-2024 17:00',
+ dateStart: '26-01-2024 15:00',
placeDTO: {
name: 'Test Location',
address: 'address',
@@ -20,35 +20,16 @@ describe('SportEvent', async () => {
player1Name: 'Player One',
player2Name: 'Player Two',
}
-
- const formatDate = (dateArray: string) => {
- const [year, month, day, hours, minutes] = dateArray
- const formattedDate = `${day.toString().padStart(2, '0')}-${month
- .toString()
- .padStart(
- 2,
- '0',
- )}-${year} ${hours}:${minutes.toString().padStart(2, '0')}`
- return formattedDate
- }
-
it('renders the component with correct data', () => {
render(