Previous, Next button click events with setState

Hi,
I want that when i click the previous or next buttons i will get the current min date and max date of the current week and then to put them on the state of the parent component with setState.
i am getting my events from a local server that request in the jason the start and end dates, so i need to update the state when i move around between the dates.
i tried to work with onViewChange but it didnt worked for me
this is my code:

http://docs.dhtmlx.com/scheduler/snippet/457cc5e3
http://docs.dhtmlx.com/scheduler/snippet/8a81d058

Hi @eliran150

There are 2 event that occur when you click on Next and Prev buttons: onBeforeViewChange and onViewChange.

To update the displayed date, please use setCurrentView() method

I prepared a snippet for you to demonstrate how to update the displayed date range after you click on navigation button, please check:
https://snippet.dhtmlx.com/5/88f0cf8c7