How to track Cesium Timeline Date on click over it

1. A concise explanation of the problem you’re experience

I want to capture the date of the Cesium TimeLine on click over it. Can anyone please guide me for the piece of code to capture the date on click over it.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

For example below is the timeline. My challenge is to capture the date when I click over it.

Suppose I click on 1 Jan 2018. How to capture this date programmatically.

Hi there,

It doesn’t look like there is a way to capture these events using the public API, but you can use the source for Timeline.js to see how we’ve implemented capturing mouse click events and updating the scene’s simulation time. If you come up with a good solution, it would be fantastic if you could contribute that function back to the Cesium project! Contributions are always appreciated, and I can see others wanting to use that functionality.

Thanks!

Gabby

I get the timeline bar object from document with class name.
let timelineBar = document.getElementsByClassName("cesium-viewer-timelineContainer")[0];

timelineBar.addEventListener('mouseup', streamRoot, false);

And add event to it.

function streamRoot(){
    console.log("Ohhhhh Yaaa");
    console.log(viewer.clock.currentTime.toString());
}

So you can track the time when drag the timeline pin.

Hope it can help.