File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ and this project adheres (more or less) to [Semantic Versioning](http://semver.o
7
7
8
8
## Unreleased
9
9
10
+ ### 0.17,1
11
+
12
+ ### Added
13
+
14
+ * pass canvasTimeStart/End via timelineContext to the itemRenderer prop
15
+
10
16
### 0.17.0
11
17
12
18
### Breaking
Original file line number Diff line number Diff line change @@ -458,8 +458,10 @@ This component will also be passed a `timelineContext` object:
458
458
459
459
``` typescript
460
460
{
461
- visibleTimeStart : number , // denotes the start time in ms of the timeline
462
- visibleTimeEnd : number , // denotes the end time in ms of the timeline
461
+ visibleTimeStart : number , // denotes the start time in ms of the visible timeline
462
+ visibleTimeEnd : number , // denotes the end time in ms of the visible timeline
463
+ canvasTimeStart : number , // denotes the start time in ms of the canvas timeline
464
+ canvasTimeEnd : number , // denotes the end time in ms of the canvas timeline
463
465
timelineWidth : number , // denotes the width in pixels of the timeline
464
466
}
465
467
```
Original file line number Diff line number Diff line change @@ -251,15 +251,24 @@ export default class ReactCalendarTimeline extends Component {
251
251
}
252
252
253
253
getTimelineContext = ( ) => {
254
- const { width, visibleTimeStart, visibleTimeEnd } = this . state
254
+ const {
255
+ width,
256
+ visibleTimeStart,
257
+ visibleTimeEnd,
258
+ canvasTimeStart
259
+ } = this . state
260
+ const zoom = visibleTimeEnd - visibleTimeStart
261
+ const canvasTimeEnd = canvasTimeStart + zoom * 3
255
262
256
263
//TODO: Performance
257
264
//prob wanna memoize this so we ensure that if no items changed,
258
265
//we return same context reference
259
266
return {
260
267
timelineWidth : width ,
261
268
visibleTimeStart,
262
- visibleTimeEnd
269
+ visibleTimeEnd,
270
+ canvasTimeStart,
271
+ canvasTimeEnd
263
272
}
264
273
}
265
274
You can’t perform that action at this time.
0 commit comments