@@ -7,7 +7,7 @@ import CalendarMonthIcon from '@mui/icons-material/CalendarMonth';
77import { LocationOnOutlined , Computer } from '@mui/icons-material' ;
88import { useHistory } from 'react-router-dom' ;
99import { NERButton } from '../../../components/NERButton' ;
10- import { formatDateOnly , formatEventDate } from 'shared' ;
10+ import { formatDateOnly } from 'shared' ;
1111
1212interface EventProps {
1313 event : Event ;
@@ -58,10 +58,7 @@ const DisplayStatus: React.FC<EventProps> = ({ event, user }) => {
5858 ) ;
5959} ;
6060
61- const getWeekday = ( date : Date , utc = false ) : string => {
62- if ( utc ) {
63- return formatDateOnly ( date , 'dddd' ) ;
64- }
61+ const getWeekday = ( date : Date ) : string => {
6562 const weekdays : string [ ] = [ 'Sunday' , 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' , 'Saturday' ] ;
6663 return weekdays [ date . getDay ( ) ] ;
6764} ;
@@ -70,9 +67,7 @@ const UpcomingEventCard: React.FC<EventProps> = ({ event, user }) => {
7067 const theme = useTheme ( ) ;
7168 const firstScheduledDate = event . initialDateScheduled || event . scheduledTimes [ 0 ] ?. startTime ;
7269 const displayDate = firstScheduledDate ? new Date ( firstScheduledDate ) : new Date ( ) ;
73- // initialDateScheduled is a date-only field (@db.Date), scheduledTimes startTime is a full datetime
74- const isDateOnly = ! ! event . initialDateScheduled ;
75- const formattedDate = isDateOnly ? formatDateOnly ( displayDate , 'MM/DD' ) : formatEventDate ( displayDate ) ;
70+ const formattedDate = formatDateOnly ( displayDate ) ;
7671
7772 const [ firstWorkPackage ] = event . workPackages ;
7873
@@ -110,7 +105,7 @@ const UpcomingEventCard: React.FC<EventProps> = ({ event, user }) => {
110105 < Stack direction = "row" spacing = { 1 } sx = { { mt : 0.5 } } >
111106 < Typography > { < CalendarMonthIcon sx = { { fontSize : 21 } } /> } </ Typography >
112107 < Typography fontWeight = { 'regular' } variant = "body2" >
113- { getWeekday ( displayDate , isDateOnly ) +
108+ { getWeekday ( displayDate ) +
114109 ', ' +
115110 formattedDate +
116111 ' @ ' +
0 commit comments