visjs / vis-timeline

📅 Create a fully customizable, interactive timelines and 2d-graphs with items and ranges.
https://visjs.github.io/vis-timeline/
Other
1.88k stars 315 forks source link

Setting title of custom timebars via function has no arguments #351

Closed smee closed 4 years ago

smee commented 4 years ago

The call to the function uses the date as this, not as the function argument. The callback will get an undefined argument but this will be bound to a Date object.

See https://github.com/visjs/vis-timeline/blob/d535f69ab067fa55f06c2f2f8f95ef9019db5bb2/lib/timeline/component/CustomTime.js#L164 should imho be

title = title.call(this,this.customTime);
yotamberk commented 4 years ago

I believe you are correct! Can you submit a PR for this fix?

vis-bot commented 4 years ago

:tada: This issue has been resolved in version 7.3.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: