Skip to content
Snippets Groups Projects
Commit 3b8bd98c authored by danieldeng2's avatar danieldeng2
Browse files

Gracefully handle weekend indicators

parent 299f215c
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,7 @@ class Timeline extends React.Component<TimelineProps, TimelineState> { ...@@ -85,7 +85,7 @@ class Timeline extends React.Component<TimelineProps, TimelineState> {
render() { render() {
const termStart = new Date("2020-09-28"); const termStart = new Date("2020-09-28");
const activeDay = new Date("2020-10-01"); const activeDay = new Date("2020-10-23");
const numWeeks = 11; const numWeeks = 11;
const trackHeight = 4.25; const trackHeight = 4.25;
const [moduleHeadings, timelineBackgrounds] = this.generateGridItems( const [moduleHeadings, timelineBackgrounds] = this.generateGridItems(
...@@ -96,6 +96,7 @@ class Timeline extends React.Component<TimelineProps, TimelineState> { ...@@ -96,6 +96,7 @@ class Timeline extends React.Component<TimelineProps, TimelineState> {
Math.ceil( Math.ceil(
((activeDay.getTime() - termStart.getTime()) / 86400000 / 7) * 6 ((activeDay.getTime() - termStart.getTime()) / 86400000 / 7) * 6
) + 1; ) + 1;
console.log(activeColumn);
return ( return (
<div className={styles.timelineContainer}> <div className={styles.timelineContainer}>
<MyBreadcrumbs /> <MyBreadcrumbs />
...@@ -134,6 +135,10 @@ class Timeline extends React.Component<TimelineProps, TimelineState> { ...@@ -134,6 +135,10 @@ class Timeline extends React.Component<TimelineProps, TimelineState> {
<div <div
className={styles.dayIndicatorColumn} className={styles.dayIndicatorColumn}
style={{ style={{
visibility:
activeDay.getDay() === 6 || activeDay.getDay() == 0
? "hidden"
: "visible",
gridColumn: `${activeColumn} / ${activeColumn + 1}`, gridColumn: `${activeColumn} / ${activeColumn + 1}`,
}} }}
></div> ></div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment