Skip to content

Commit

Permalink
[new #50] center button
Browse files Browse the repository at this point in the history
  • Loading branch information
PluharVit committed Dec 12, 2022
1 parent 6d36d51 commit 307adec
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/components/PlanningTool.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,19 @@ class PlanningTool extends Component {
showOverview = () => {
const {defaultTimeStart, defaultTimeEnd} = this.state

this.timeline.current.updateScrollCanvas(defaultTimeStart.valueOf(), defaultTimeEnd.valueOf())
this.timeline.current.updateScrollCanvas(
defaultTimeStart.valueOf(),
defaultTimeEnd.valueOf()
)
}

showCurrentWeek = () => {
const now = moment()

this.timeline.current.updateScrollCanvas(
now.clone().subtract(84, 'hour').valueOf(),
now.clone().add(84, 'hour').valueOf()
)
}

renderGroup = (group) => {
Expand Down Expand Up @@ -1816,6 +1828,12 @@ class PlanningTool extends Component {
>
Overview
</button>
<button
className="action-button"
onClick={this.showCurrentWeek}
>
Center
</button>
</div>
</div>
</div>
Expand Down

0 comments on commit 307adec

Please sign in to comment.