MonthCalendar

This macro is for those who want to use MoinMoin as a Personal Information Manager and need a calendar wiki integration.

Example

Usage:
[[MonthCalendar(BasePage,year,month,monthoffset,monthoffset2,height6)]]

each parameter can be empty and then defaults to currentpage or currentdate or monthoffset=0


Samples:

Calendar of Page SampleUser, this year's december: 
[[MonthCalendar(SampleUser,,12)]]

Calendar of current Page, this year's december:
[[MonthCalendar(,,12)]]

Calendar of December, 2001:
[[MonthCalendar(,2001,12)]]

Calendar of the month two months after December, 2001
(maybe doesn't make much sense, but is possible)
[[MonthCalendar(,2001,12,+2)]]

Calendar of year 2002 (every month padded to height of 6):
||||||Year 2002||
||[[MonthCalendar(,2002,1,,,1)]]||[[MonthCalendar(,2002,2,,,1)]]||[[MonthCalendar(,2002,3,,,1)]]||
||[[MonthCalendar(,2002,4,,,1)]]||[[MonthCalendar(,2002,5,,,1)]]||[[MonthCalendar(,2002,6,,,1)]]||
||[[MonthCalendar(,2002,7,,,1)]]||[[MonthCalendar(,2002,8,,,1)]]||[[MonthCalendar(,2002,9,,,1)]]||
||[[MonthCalendar(,2002,10,,,1)]]||[[MonthCalendar(,2002,11,,,1)]]||[[MonthCalendar(,2002,12,,,1)]]||

Current calendar of me, also showing entries of A and B:
[[MonthCalendar(MyPage*TestUserA*TestUserB)]]

SubPage calendars:
[[MonthCalendar(MyName/CalPrivate)]]
[[MonthCalendar(MyName/CalBusiness)]]
[[MonthCalendar(MyName/CalBusiness*MyName/CalPrivate)]]

Anniversary Calendars: (no year data)
[[MonthCalendar(Yearly,,,+1,,6,1)]]

This creates calendars of the format Yearly/MM-DD
By leaving out the year, you can set birthdays, and anniversaries in this
calendar and not have to re-enter each year.

Display

The simplest version looks like this: --> -->

ValueError

year is out of range

If you want to report a bug, please save this page and attach it to your bug report.

Traceback

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

  1. /home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/request.py in run (self=<MoinMoin.request.RequestCGI object at 0x402e444c>)

    1. 1170 self.page.send_page(self, msg=msg)
    2. 1171 else:
    3. 1172 handler(self.page.page_name, self)
    4. 1173
    5. 1174 # generate page footer (actions that do not want this footer use
    • handler = <function do_show at 0x4058095c>
    • self = <MoinMoin.request.RequestCGI object at 0x402e444c>
    • self.page = <MoinMoin.Page.Page instance at 0x4057276c>
    • self.page.page_name = u'HelpOnMacros/MonthCalendar'
  2. /home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/wikiaction.py in do_show (pagename=u'HelpOnMacros/MonthCalendar', request=<MoinMoin.request.RequestCGI object at 0x402e444c>)

    1. 466 else:
    2. 467 request.cacheable = 1
    3. 468 Page(request, pagename).send_page(request, count_hit=1)
    4. 469
    5. 470
    • global Page = <class MoinMoin.Page.Page at 0x405666bc>
    • request = <MoinMoin.request.RequestCGI object at 0x402e444c>
    • pagename = u'HelpOnMacros/MonthCalendar'
    • ).send_page undefined
    • count_hit undefined
  3. /home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/Page.py in send_page (self=<MoinMoin.Page.Page instance at 0x4066a16c>, request=<MoinMoin.request.RequestCGI object at 0x402e444c>, msg='', **keywords={'count_hit': 1})

    1. 1254 format_args=pi_formatargs,
    2. 1255 do_cache=do_cache,
    3. 1256 start_line=pi_lines)
    4. 1257
    5. 1258 # check for pending footnotes
    • start_line undefined
    • pi_lines = 4
  4. /home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/Page.py in send_page_content (self=<MoinMoin.Page.Page instance at 0x4066a16c>, request=<MoinMoin.request.RequestCGI object at 0x402e444c>, Parser=<class MoinMoin.parser.wiki.Parser at 0x40697d4c>, body=u'== MonthCalendar ==\n\nThis macro is for those who...lendar(OtherUser,,,-1)]]\n\nsee also: HelpOnMacros\n', format_args=u'', do_cache=1, **kw={'start_line': 4})

    1. 1345 try:
    2. 1346 code = self.loadCache(request)
    3. 1347 self.execute(request, parser, code)
    4. 1348 except Exception, e:
    5. 1349 if not is_cache_exception(e):
    • self = <MoinMoin.Page.Page instance at 0x4066a16c>
    • self.execute = <bound method Page.execute of <MoinMoin.Page.Page instance at 0x4066a16c>>
    • request = <MoinMoin.request.RequestCGI object at 0x402e444c>
    • parser = <MoinMoin.parser.wiki.Parser instance at 0x4066a7ec>
    • code = <code object <module> at 0x404ec0b0, file "HelpOnMacros/MonthCalendar", line 2>
  5. /home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/Page.py in execute (self=<MoinMoin.Page.Page instance at 0x4066a16c>, request=<MoinMoin.request.RequestCGI object at 0x402e444c>, parser=<MoinMoin.parser.wiki.Parser instance at 0x4066a7ec>, code=<code object <module> at 0x404ec0b0, file "HelpOnMacros/MonthCalendar", line 2>)

    1. 1374 __file__ = os.path.join(MoinMoin.__loader__.archive, 'dummy')
    2. 1375 try:
    3. 1376 exec code
    4. 1377 except 'CacheNeedsUpdate':
    5. 1378 raise Exception('CacheNeedsUpdate')
    • code = <code object <module> at 0x404ec0b0, file "HelpOnMacros/MonthCalendar", line 2>
  6. /home/pangloss/public_html/Tabula/HelpOnMacros/MonthCalendar in ()

  7. /home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/formatter/base.py in macro (self=<MoinMoin.formatter.text_html.Formatter instance at 0x4068510c>, macro_obj=<MoinMoin.wikimacro.Macro instance at 0x4066a84c>, name=u'MonthCalendar', args=None)

    1. 288 def macro(self, macro_obj, name, args):
    2. 289 # call the macro
    3. 290 return macro_obj.execute(name, args)
    4. 291
    5. 292 def _get_bang_args(self, line):
    • macro_obj = <MoinMoin.wikimacro.Macro instance at 0x4066a84c>
    • macro_obj.execute = <bound method Macro.execute of <MoinMoin.wikimacro.Macro instance at 0x4066a84c>>
    • name = u'MonthCalendar'
    • args = None
  8. /home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/wikimacro.py in execute (self=<MoinMoin.wikimacro.Macro instance at 0x4066a84c>, macro_name=u'MonthCalendar', args=None)

    1. 118 else:
    2. 119 raise ImportError("Cannot load macro %s" % macro_name)
    3. 120 return execute(self, args)
    4. 121
    5. 122 def _m_lang(self, text):
    • execute = <function execute at 0x406ef95c>
    • self = <MoinMoin.wikimacro.Macro instance at 0x4066a84c>
    • args = None
  9. /home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/macro/MonthCalendar.py in execute (macro=<MoinMoin.wikimacro.Macro instance at 0x4066a84c>, text=None)

    1. 296
    2. 297 # get the calendar
    3. 298 monthcal = calendar.monthcalendar(year, month)
    4. 299
    5. 300 # european / US differences
    • monthcal undefined
    • global calendar = <module 'calendar' from '/home/pangloss/lib/python/lib/python2.5/calendar.pyc'>
    • calendar.monthcalendar = <bound method TextCalendar.monthdayscalendar of <calendar.TextCalendar object at 0x40714c8c>>
    • year = 0
    • month = 11
  10. /home/pangloss/lib/python/lib/python2.5/calendar.py in monthdayscalendar (self=<calendar.TextCalendar object at 0x40714c8c>, year=0, month=11)

    1. 210 Each row represents a week; days outside this month are zero.
    2. 211 """
    3. 212 days = list(self.itermonthdays(year, month))
    4. 213 return [ days[i:i+7] for i in xrange(0, len(days), 7) ]
    5. 214
    • days undefined
    • builtin list = <type 'list'>
    • self = <calendar.TextCalendar object at 0x40714c8c>
    • self.itermonthdays = <bound method TextCalendar.itermonthdays of <calendar.TextCalendar object at 0x40714c8c>>
    • year = 0
    • month = 11
  11. /home/pangloss/lib/python/lib/python2.5/calendar.py in itermonthdays (self=<calendar.TextCalendar object at 0x40714c8c>, year=0, month=11)

    1. 181 outside the specified month the day number is 0.
    2. 182 """
    3. 183 for date in self.itermonthdates(year, month):
    4. 184 if date.month != month:
    5. 185 yield 0
    • date undefined
    • self = <calendar.TextCalendar object at 0x40714c8c>
    • self.itermonthdates = <bound method TextCalendar.itermonthdates of <calendar.TextCalendar object at 0x40714c8c>>
    • year = 0
    • month = 11
  12. /home/pangloss/lib/python/lib/python2.5/calendar.py in itermonthdates (self=<calendar.TextCalendar object at 0x40714c8c>, year=0, month=11)

    1. 154 dates outside the specified month.
    2. 155 """
    3. 156 date = datetime.date(year, month, 1)
    4. 157 # Go back to the beginning of the week
    5. 158 days = (date.weekday() - self.firstweekday) % 7
    • date undefined
    • global datetime = <module 'datetime' from '/home/pangloss/lib/python/lib/python2.5/lib-dynload/datetime.so'>
    • datetime.date = <type 'datetime.date'>
    • year = 0
    • month = 11

ValueError

year is out of range

  • args = ('year is out of range',)
  • message = 'year is out of range'

System Details

  • Date: Wed, 15 Jul 2026 23:02:13 +0000
  • Platform: Linux owl.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686
  • Python: Python 2.5 (/home/pangloss/lib/python/bin/python)
  • MoinMoin: Release 1.5.7 (release)