Previous, Next button click events with setState

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:

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: