Skip to content

Commit c5809b6

Browse files
committed
Add Date Scheduled To DR Tab
1 parent ee36001 commit c5809b6

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/frontend/src/pages/GanttPage/GanttChartComponents/GanttTaskBar/GanttTaskBarDisplay.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
} from './GanttTaskBarDisplayStyles';
2222
import { CSSProperties } from 'react';
2323
import { ArcherElement } from 'react-archer';
24+
import { datePipe } from '../../../../utils/pipes';
2425

2526
interface 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) && (

src/frontend/src/utils/pipes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
};

0 commit comments

Comments
 (0)