Custom Calendar Expression

I’m working on a custom calendar that uses this expression:

function getDaysInMonth(month, year) {
	var date = new Date(year, month, 1);
	var days = [];

	var lastDay = new Date(year, month, 0).getDate();
	for (i = date.getDay() - 1; i >= 0; i--) {
		days.push(new Date(year, month - 1, lastDay - i));
	}
	while (date.getMonth() === month) {
		days.push(new Date(date));
		date.setDate(date.getDate() + 1);
	}

	var date3 = new Date(year, month + 1, 1);
	for (i = days[days.length - 1].getDay(); i != 6; i++) {
		days.push(new Date(date3));
		date3.setDate(date3.getDate() + 1);
	}

	for (i = days.length; i != 42; i++) {
		days.push(new Date(date3));
		date3.setDate(date3.getDate() + 1);
	}
	return days;
}



getDaysInMonth(Current date/time +(months):Main Calendar’s monthOffset:extract month - 1, Current date/time +(months):Main Calendar’s monthOffset:extract year); 

and this is the error that I get:

Can anyone help me out? Thanks!

well, this is not valid js. bubble’s expressions are available only in the editor. you may want to pass the data to the plugin using properties.

This topic was automatically closed after 70 days. New replies are no longer allowed.