I'm trying to understand how the Calendar works in the template

3 replies · opened Dec 16, 2019

IitzikfishelyDec 16, 2019

If I try to copy the element to my project it comes out as numbers of the specific month. but I guess it comes live from somewhere... can you please help me understand what I need to take from the template in order to put it in my project and for the calendar to be able to appear correctly? what I see now in my project is what shown in the photo attached.
please help.

SSemicolon WebSTAFFDec 17, 2019

Hello,

To make the Calendars work and look as expected, here is the List of Files you will need to add to your Project:

In the Document <head>:


- 

In the Footer after the js/functions.js JS File Linking:


	var cal = $( '#calendar' ).calendario( {
			onDayClick : function( $el, $contentEl, dateProperties ) {

				for( var key in dateProperties ) {
					console.log( key + ' = ' + dateProperties[ key ] );
				}

			},
			caldata : canvasEvents
		} ),
		$month = $( '#calendar-month' ).html( cal.getMonthName() ),
		$year = $( '#calendar-year' ).html( cal.getYear() );

	$( '#calendar-next' ).on( 'click', function() {
		cal.gotoNextMonth( updateMonthYear );
	} );
	$( '#calendar-prev' ).on( 'click', function() {
		cal.gotoPreviousMonth( updateMonthYear );
	} );
	$( '#calendar-current' ).on( 'click', function() {
		cal.gotoNow( updateMonthYear );
	} );

	function updateMonthYear() {
		$month.html( cal.getMonthName() );
		$year.html( cal.getYear() );
	};

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

IitzikfishelyDec 18, 2019

but what is the source of the calendar? is it like from google?
what code do I use inside the page for the calendar to load? it's still not working...

SSemicolon WebSTAFFDec 18, 2019

Hello,

The Calendar Loads the events from the js/events-data.js File. If it is still not working for you, please provide us with a Live URL so that we can check out the exact issue and provide you with more assistance on this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard