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

Timeline item time crossing, item moving interval, item ready for change state. #340

Closed KonstantinKhudoyarov closed 4 years ago

KonstantinKhudoyarov commented 4 years ago

interview-ui

Hi, could you help me?

  1. Is it possible to work with time crossings, for example, when there is an attempt to create a new interview that overlaps with the existing one? It is necessary not to let the items overlap in time.
  2. Is it possible to move an item with an interval of 5 minutes? I found the ability to move only with an interval of 1 minute.
  3. Is it possible, when loading thimeline, to set the state of an item ready for a change that calls for action (delete, drag, expand)? item-ready-for-action

Thanks.

yotamberk commented 4 years ago

Hi @KonstantinKhudoyarov

  1. you can implement this in your app when you create the item, before adding it, check for overlaps. If you use the dragging implementation via the timeline, you can use the even listeners of shown in https://visjs.github.io/vis-timeline/examples/timeline/interaction/eventListeners.html
  2. check out the snap option: https://visjs.github.io/vis-timeline/examples/timeline/editing/customSnappingOfItems.html
  3. not sure what you mean but you can control individual item states with the item property: https://visjs.github.io/vis-timeline/examples/timeline/editing/individualEditableItems.html