I’m getting the following area after adding my custom widget to my page:
Problem assembling output for item (name=“calendar”, id=3-101-32574) with template: perc.widget. Underlying error: Encountered “, “dddd, MMM dd, yyyy hh:mm tt”) + " to " + \t\t\t” at perc.widget[line 39, column 120] Was expecting one of: “,” … “)” … … … “(” … See log for stack trace.
I’ve got the following inline script block with this widget. I’ve made sure it’s got its supporting JavaScript libraries includes properly. The code works fine outside of CM1. trying to get it to work as a custom widget.
<script type="text/javascript"> <br /> $(document).ready(function() { <br /><br />
$('#calendar').fullCalendar({ <br />
header: { <br />
left: 'prev,next today', <br />
center: '', <br />
right: 'month,basicWeek,basicDay' <br />
}, <br /><br />
defaultView: 'month', <br />
events: { <br />
url: '$GoogleCalendarURL', <br />
className: 'gcal-event',
// an option! <br />
currentTimezone: 'America/New_York' // an option! <br />
}, <br />
eventClick: function(calEvent, jsEvent, view) { <br /><br />
$('#event-popup .event-popup_content').html(''); <br />
$('#event-popup .event-popup_content').append("<h2>" + calEvent.title + "<h2>"); <br /><br />
var eventTime = ""; <br /><br />
if (calEvent.allDay) { <br />
eventTime = "<span>All Day</span>"; <br />
} <br />
else { <br />
eventTime = "<span>" + $.fullCalendar.formatDate(calEvent.start, "dddd, MMM dd, yyyy hh:mm tt") + " to " +
$.fullCalendar.formatDate(calEvent.end, "dddd, MMM dd, yyyy hh:mm tt") +"</span>"; <br />
} <br /><br />
$('#event-popup .event-popup_content').append("<div class='event_date'>" + eventTime + "</div>"); <br />
$('#event-popup .event-popup_content').append("<div class='event_location'>" + calEvent.location + "</div>");
<br />
$('#event-popup .event-popup_content').append("<div class='event_desc'>" + calEvent.description + "</div>"); <br /><br />
return false; <br />
}, <br />
eventRender: function(event, element) { <br /><br />
element.attr('data-mfp-src', '#event-popup'); <br /><br />
element.magnificPopup({ <br />
type: 'inline', <br /><br />
fixedContentPos: false, <br />
fixedBgPos: true, <br /><br />
overflowY: 'auto', <br /><br />
closeBtnInside: true, <br />
preloader: false, <br /><br />
midClick: true, <br />
removalDelay: 300, <br />
mainClass: 'my-mfp-zoom-in' <br />
}); <br />
} <br />
}); <br /><br />
}); <br /> </script>
where '$GoogleCalendarURL is the field value I take in from the user… I’m formatting some dates into a string for display in the calendar.
any help is appreciated.