Loading Calendar app to a specific Month/Year

Good afternoon,

Does anyone have any advice on how to load a Scriptcase Calendar app to show a previous month on load? Everything I try, the calendar ALWAYS loads the current month.

I’m at my wits end. I’ve been working on this for almost a week, and all I have to show are the lumps on my head from banging it on the wall… This seems like such a simple thing to accomplish but I’m failing miserably.

Thanks so much to anyone who can point me in the right direction.

image

In onCalendarScriptInitEvent

$fecha = "2024-02-01";  // fecha deseada INITIAL DATE

echo <<<HTML
<script>
window.addEventListener('load', () => {
    if (window.scMainCalendar) {
        scMainCalendar.gotoDate('{$fecha}');
    }
});
</script>
HTML;