Skip to content

Commit

Permalink
#998 duplicated hugh's timeline function over to day_calendar too (#1005
Browse files Browse the repository at this point in the history
)
  • Loading branch information
maxyeo authored and noahpresler committed Aug 13, 2017
1 parent 5b8977e commit 066d4c7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions static/js/redux/ui/day_calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,18 @@ class DayCalendar extends React.Component {
}

getTimelineStyle() {
if ((new Date()).getHours() > this.props.endHour || (new Date()).getHours() < 8) {
const now = new Date();
if (now.getHours() > this.props.endHour || // if the current time is before
now.getHours() < 8 //||// 8am or after the schedule end
// now.getDay() === 0 || // time or if the current day is
// now.getDay() === 6 // Saturday or Sunday, then
) { // display no line
return { display: 'none' };
}
const diff = Math.abs(new Date() - new Date().setHours(8, 0, 0));
const mins = Math.ceil((diff / 1000) / 60);
const top = ((mins / 15.0) * 13) + 65;
return { top };
const top = (mins / 15.0) * 13;
return { top, zIndex: 1 };
}

getCalendarRows() {
Expand Down Expand Up @@ -240,7 +245,6 @@ class DayCalendar extends React.Component {
onSwipedLeft={this.swipedLeft}
>
<div className="fc-view-container" style={{}}>
<div className="fc-timeline" style={this.getTimelineStyle()} />
<div className="fc-view fc-settimana-view fc-agenda-view">
<table>
<tbody className="fc-body">
Expand Down Expand Up @@ -269,6 +273,7 @@ class DayCalendar extends React.Component {
</tbody>
</table>
</div>
<div className="fc-timeline" style={this.getTimelineStyle()} />
<div className="fc-content-skeleton">
<SlotManagerContainer
days={[DAYS[this.state.day]]}
Expand Down

0 comments on commit 066d4c7

Please sign in to comment.