File tree Expand file tree Collapse file tree
pages/GanttPage/GanttChartComponents/GanttTaskBar Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121} from './GanttTaskBarDisplayStyles' ;
2222import { CSSProperties } from 'react' ;
2323import { ArcherElement } from 'react-archer' ;
24+ import { datePipe } from '../../../../utils/pipes' ;
2425
2526interface GanttTaskBarDisplayProps {
2627 days : Date [ ] ;
@@ -182,7 +183,15 @@ const GanttTaskBarDisplay = ({
182183 onMouseOver = { ( e ) => handleOnMouseOver ( e , transformDesignReviewToGanttTask ( designReview ) ) }
183184 onMouseLeave = { handleOnMouseLeave }
184185 onClick = { ( ) => history . push ( `${ routes . CALENDAR } /${ designReview . designReviewId } ` ) }
185- />
186+ >
187+ < Typography
188+ variant = "body1"
189+ sx = { taskNameContainerStyles ( task ) }
190+ onClick = { ( ) => history . push ( `${ routes . CALENDAR } /${ designReview . designReviewId } ` ) }
191+ >
192+ { datePipe ( designReview . dateScheduled , false ) }
193+ </ Typography >
194+ </ div >
186195 ) ;
187196 } ) }
188197 { highlightedChange && isHighlightedChangeOnGanttTask ( highlightedChange , task ) && (
Original file line number Diff line number Diff line change @@ -69,13 +69,13 @@ export const emDashPipe = (str: string) => {
6969 * so to get around that we do the toDateString() of the time and pass it into the Date constructor
7070 * where the constructor assumes it's in UTC and makes the correct Date object finally
7171 */
72- export const datePipe = ( date ?: Date ) => {
72+ export const datePipe = ( date ?: Date , includeYear = true ) => {
7373 if ( ! date ) return '' ;
7474 date = typeof date == 'string' ? new Date ( date ) : new Date ( date . toDateString ( ) ) ;
7575 return date . toLocaleDateString ( 'en-US' , {
7676 day : '2-digit' ,
7777 month : '2-digit' ,
78- year : 'numeric' ,
78+ year : includeYear ? 'numeric' : undefined ,
7979 timeZone : 'UTC'
8080 } ) ;
8181} ;
You can’t perform that action at this time.
0 commit comments