Changes for page Calendar Macro

Last modified by Vladislav ANTOLÍK on 19.10.2026, 08:01

From version 6.1
edited by Vladislav ANTOLÍK
on 19.10.2026, 08:01
Change comment: Install extension [org.xwiki.contrib:macro-fullcalendar-ui/2.5.5]
To version 1.1
edited by administrator
on 19.07.2023, 15:23
Change comment: Install extension [org.xwiki.contrib:macro-fullcalendar-ui/2.2.12]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.vantolik
1 +XWiki.administrator
Content
... ... @@ -7,7 +7,7 @@
7 7  
8 8   {{calendar classname="Blog.BlogPostClass" startfield="publishDate" editable="false" year="2009" month="5" date="1" /}}
9 9  
10 -or
10 +or
11 11  
12 12   {{velocity}}
13 13   {{calendar json="${xwiki.getDocument("Calendar.ExampleJSON").getURL("get")}" editable="false" year="2012" month="5" date="18" /}}
XWiki.WikiMacroClass[0]
Macro code
... ... @@ -6,11 +6,7 @@
6 6  #else
7 7   #set($calcounter = 1)
8 8  #end
9 -#set($containerId = "calendar${calcounter}")
10 -#if ($xcontext.macro.params.id)
11 - #set ($containerId = $xcontext.macro.params.id)
12 -#end
13 -(% id="$services.rendering.escape($containerId, 'xwiki/2.1')" class="xwiki-fullcalendar" %)
9 +(% id="calendar${calcounter}" %)
14 14  (((
15 15  )))
16 16  
... ... @@ -158,7 +158,7 @@
158 158   function init() {
159 159   // The page is now ready, initialize the calendar...
160 160   var progressNotification;
161 - $('#${containerId}').fullCalendar({
157 + $('#calendar${calcounter}').fullCalendar({
162 162   views: {
163 163   month : {
164 164   columnFormat: "$!services.localization.render('xwiki.calendar.columnFormat.month')",
... ... @@ -189,7 +189,7 @@
189 189   googleCalendarApiKey : "$gApiKey",
190 190   eventSources: [
191 191   #if($json != $jsonService || "$!xcontext.macro.params.classname" != '')
192 - "${json}#if($stringtool.contains($json, "?"))&#{else}?#{end}xpage=plain&outputSyntax=plain&classname=$!{xcontext.macro.params.classname}&startfield=$!{xcontext.macro.params.startfield}&endfield=$!{xcontext.macro.params.endfield}&durationfield=$!{xcontext.macro.params.durationfield}&extraFields=$!{extraFields}&form_token=$!{services.csrf.token}"
188 + "${json}#if($stringtool.contains($json, "?"))&#{else}?#{end}xpage=plain&outputSyntax=plain&classname=$!{xcontext.macro.params.classname}&startfield=$!{xcontext.macro.params.startfield}&endfield=$!{xcontext.macro.params.endfield}&durationfield=$!{xcontext.macro.params.durationfield}&extraFields=$!{extraFields}"
193 193   #end
194 194   #if($!gCal != '')
195 195   ,
... ... @@ -234,7 +234,6 @@
234 234   tooltip = tooltip + "$services.localization.render('xwiki.calendar.event.description') " + event.description;
235 235   }
236 236   element.attr('title', tooltip);
237 - document.fire("xwiki:fullcalendar:${containerId}:eventrendering", { eventObj: event, eventElement: element });
238 238   },
239 239   loading: function( isLoading) {
240 240   if (isLoading) {
... ... @@ -257,13 +257,14 @@
257 257   });
258 258   }
259 259  
260 - function scheduleInit() {
261 - clearTimeout(window['_calMacroTimer${calcounter}']);
262 - window['_calMacroTimer${calcounter}'] = setTimeout(init, 200);
263 - }
264 -
265 - $(window).off('.calMacro${calcounter}').on('xwiki:dom:updated.calMacro${calcounter}', scheduleInit);
266 - scheduleInit();
255 + // Load the calendar in edit mode.
256 + $(window).on('xwiki:dom:updated', function() {
257 + init();
258 + });
259 + // Load the calendar in view mode.
260 + $(document).ready(function() {
261 + init();
262 + });
267 267   });
268 268  });
269 269  </script>
defaultCategory
... ... @@ -1,0 +1,1 @@
1 +Content
XWiki.WikiMacroParameterClass[19]
Parameter description
... ... @@ -1,1 +1,0 @@
1 -The id (html attribute) that will be set to the wrapper of the calendar.
Parameter mandatory
... ... @@ -1,1 +1,0 @@
1 -No
Parameter name
... ... @@ -1,1 +1,0 @@
1 -id