Skip to content

Commit aee9220

Browse files
refactor: update date formatting in TrainDetails and TripDetails components
1 parent 53d3cd3 commit aee9220

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

app/trains/train/[trainID]/TrainDetails.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const TrainDetails = ({ trainID }) => {
111111
</p>
112112
<p>
113113
<strong>Date:</strong>{" "}
114-
{new Date(data.train.date).toLocaleDateString()}
114+
{new Date(data.train.date).toDateString()}
115115
</p>
116116
<h3 className="text-lg font-semibold mt-4">
117117
Common Trains Trips (Same Train Number and Date):
@@ -156,7 +156,7 @@ const TrainDetails = ({ trainID }) => {
156156
</p>
157157
<p>
158158
<strong>Date:</strong>{" "}
159-
{new Date(train.date).toLocaleDateString()}
159+
{new Date(train.date).toDateString()}
160160
</p>
161161
</li>
162162
))}

app/trips/trip/[tripID]/TripDetails.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ const TripDetails = ({ tripID }) => {
114114
{mapping.locations[data.trip.destination]}
115115
</p>
116116
<p>
117-
<strong>Date:</strong>{" "}
118-
{new Date(data.trip.date).toLocaleDateString()}
117+
<strong>Date:</strong> {new Date(data.trip.date).toDateString()}
119118
&nbsp;&nbsp;
120119
<strong>Time Slot:</strong> {mapping.slots[data.trip.time]}
121120
</p>
@@ -166,7 +165,7 @@ const TripDetails = ({ tripID }) => {
166165
</p>
167166
<p>
168167
<strong>Date:</strong>{" "}
169-
{new Date(trip.date).toLocaleDateString()}
168+
{new Date(trip.date).toDateString()}
170169
&nbsp;&nbsp;
171170
<strong>Time Slot:</strong>{" "}
172171
{mapping.slots[trip.time]}

0 commit comments

Comments
 (0)