Difference between revisions of "Widget:Calendar"

From Hackerspace ACKspace
Jump to: navigation, search
m (event kind array -> list them all)
m (that's it, I'm going home)
Line 205: Line 205:
  
 
             if ( eventKinds.includes( "Conference" ) )
 
             if ( eventKinds.includes( "Conference" ) )
                 _td.className += " purple";
+
                 _td.className += " hl-purple";
 
             else if ( eventKinds.includes( "Festival" ) || eventKinds.includes( "Party" ) )
 
             else if ( eventKinds.includes( "Festival" ) || eventKinds.includes( "Party" ) )
                 _td.className += " green";
+
                 _td.className += " hl-green";
 
             else if ( eventKinds.includes( "Meeting" ) )
 
             else if ( eventKinds.includes( "Meeting" ) )
                 _td.className += " yellow";
+
                 _td.className += " hl-yellow";
 
             else if ( eventKinds.includes( "Lecture" ) )
 
             else if ( eventKinds.includes( "Lecture" ) )
                 _td.className += " blue";
+
                 _td.className += " hl-blue";
 
             else
 
             else
                 _td.className += " red";
+
                 _td.className += " hl-red";
 
         };
 
         };
  

Revision as of 16:15, 19 July 2018

This widget allows you to display a calendar

Created by Xopr

Using this widget

To insert this widget, use the following code:

{{#widget:Calendar
|date=february 26 2011
|w=true
|hl.26 february 2011=blue
|hl.1 march 2011=red
|t.17 february 2011=First peek into ACKspace's new space
}}

This will give the following result:

Note:

  • all parameters are optional. If date is omitted, the current month will be displayed
  • you can highlight dates by using the hl parameter, followed by a dot and the date you want to highlight. Available colors are: red, green, blue, yellow, cyan and purple
  • you can also add titles per-day using the 't' parameter, followed by a dot and the date you want to highlight.
  • w (show week numbers) is optional

Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy full source code of this page to your wiki as Widget:Calendar article.