mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-16 00:50:18 -04:00
sort of fix dates
This commit is contained in:
parent
3b249047c5
commit
c61f0aa914
|
@ -5,9 +5,11 @@ import { useContext } from 'react';
|
||||||
import EventContext from './EventContext';
|
import EventContext from './EventContext';
|
||||||
|
|
||||||
export default function EventDetails() {
|
export default function EventDetails() {
|
||||||
const { startTime, endTime, formattedAddress } =
|
const { startTime, duration, formattedAddress } =
|
||||||
useContext(EventContext).event;
|
useContext(EventContext).event;
|
||||||
|
|
||||||
|
const endTime = new Date(new Date(startTime).getTime() + duration * 60);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
|
@ -25,7 +27,7 @@ export default function EventDetails() {
|
||||||
>
|
>
|
||||||
<EventIcon style={{ marginRight: '1rem' }} />
|
<EventIcon style={{ marginRight: '1rem' }} />
|
||||||
{endTime
|
{endTime
|
||||||
? formatStartAndEndTime(startTime, endTime)
|
? formatStartAndEndTime(startTime, endTime.toISOString())
|
||||||
: new Date(startTime).toLocaleString()}
|
: new Date(startTime).toLocaleString()}
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user