Function getCurrentIdxForTimeline