open CALENDAR on specific date

Is it possible when opening a calendar app to show a specific date ?

Now SC is opening the calendar and showing the actual date.

When you click a date in the mini calendar, SC goes to this date.
I found this in the webpage some code related to this click. But how do i call this ‘dayclick’-function when loading calendar-app?

$(document).ready(function(){
    $('#calendar_mini').fullCalendar({
        monthNames:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],
        monthNamesShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],
        dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],
        dayNamesShort:["Zo","Ma","Di","Wo","Do","Vr","Za"],
        buttonText:{
            today:"Vandaag",
        },
        firstDay:1,
        header:{
            left:'prev,next today',
            center:'title',
            right:'',
        },
        dayClick:function(date,jsEvent,view){
            $('#calendar').fullCalendar('gotoDate',date);
        },
        defaultView:'month',
    });

I found some more SC code. Anyone who can help us with this?

t.prototype.gotoDate = function(t) {
this.currentDate = this.moment(t).stripZone(),
this.renderView()

or this according the website. But still i don’t know how to implement

var noTime = $.fullCalendar.moment(‘2014-05-01’);

Something i found. When creating the fullcalendar in a blank app i managed to go to a specific date using this code.

$(document).ready(function() {
$(’#calendar’).fullCalendar(‘gotoDate’, 2017,04,21);
});

However when using this code into the events of the regular calendar app (OnCalendarApplicationInit and CalendatScriptInit), nothing happens.

Suggestions?

I found a solution myself :slight_smile:

Since the calendarframe is not yet loaded on the CalendarAppInit and CalendarScriptIni you have to use following code to set a specific date when loading the calendar APP

?>
<script>
window.onload = () => {
setTimeout(() => {
$(’#calendar’).fullCalendar(‘gotoDate’, ‘2017-04-21’);
}, 10)
}
</script>
<?php

Forgot to tell to put code above in OnCalendarScriptInit

or with ECHO

$datum=‘2015-12-31’;

echo ‘<script>
window.onload = () => {
setTimeout(() => {
$("#calendar").fullCalendar(“gotoDate”, "’.$datum.’");
}, 10)
}
</script>’;

strange, the code above works fine in every browser but not in IE. anyone a suggestion

ID of the element has the same name? Error message?

there is no error message the calendar just starts on the date of today

Thank you very much for this information

You can also add this line if you want the small Calendar to go to the right month
$(’#calendar_mini’).fullCalendar(‘gotoDate’, ‘2017-04-21’);