Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
doboy committed Aug 22, 2024
1 parent 5dafb65 commit 8f4e82a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ <h2 className="ui header">

}, []);

const dateFormat = "dddd, MMMM Do";
const dateFormat = "ddd, MMM Do";
const timeFormat = "h:mma";

const sortedBookingDates = Object.keys(bookingsData).sort();
Expand Down Expand Up @@ -374,22 +374,24 @@ <h2 className="ui header">
<tbody>
{sortedBookingDates.map((bookingDate) => {
return (<tr key={bookingDate}>
<td>{moment(bookingDate).format(dateFormat)}</td>
<td className="collapsing">{moment(bookingDate).format(dateFormat)}</td>
<td>
{bookingsData[bookingDate].map((booking) => {
return (<div key={booking.startDateTime}>
{moment(booking.startDateTime).format(timeFormat)} - {moment(booking.endDateTime).format(timeFormat)}
</div>)
})}
</td>
<td>${bookingsData[bookingDate].reduce((total, booking) => {
<td className="collapsing">${bookingsData[bookingDate].reduce((total, booking) => {
return total + booking.cost;
}, 0).toFixed(2)}</td>
</tr>);
})}
<tr>
<td><strong>Total</strong></td>
<td></td>
<td className="right aligned">
<strong>Total</strong>
</td>
<td><strong> ${totalCost.toFixed(2)}</strong></td>
</tr>
</tbody>
Expand Down

0 comments on commit 8f4e82a

Please sign in to comment.