Update shortcode values using ajax call

The problem here is how PHP works. Once the server is done processing the GET request for a page, everything related to that request (i.e. values stored in global variables) is cleared and are lost.

What you need to is to keep track of, one way or the other, the month index in the front end with js/jquery. For example you could have a scoped variable for the index. E.g.

(function() {
    var monthIndex = 0;
    var monthIncrementButton = document.getElementById('inc_month_index');
    var monthDecrementButton = document.getElementById('dec_month_index');

    monthIncrementButton.addEventListener('click', function(event){
        event.preventDefault();

        monthIndex += 1;

        // send monthIndex with ajax request data
    });

    monthDecrementButton.addEventListener('click', function(event){
        event.preventDefault();

        monthIndex -= 1;

        // send monthIndex with ajax request data
    });
})();

In your AJAX callback you can access the sent month index by inspecting the $_POST variable.

function wpse_419368_agenda_ajax_callback() {
    wp_send_json([
        'month_index' => ! empty( $_POST['monthIndex'] ) ? intval( $_POST['monthIndex'] ) : 'No index provided';
    ]);
}

add_action( 'wp_ajax_Agenda', 'wpse_419368_agenda_ajax_callback' );
add_action( 'wp_ajax_nopriv_Agenda', 'wpse_419368_agenda_ajax_callback' );

deneme bonusudeneme bonusu veren sitelerpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino