[Zope] DTML calendar widget

Ty Sarna tsarna@endicor.com
Sun, 7 Feb 1999 22:41:40 -0600 (CST)


The was some talk long ago about calendar support of some kind in
Principia.  I don't know wwhatever became of that or what kind of
features people were wanting, but this weekend I sat down and wrote a
calendar DTML widget.  You can try a sample instance of it at:

	http://www.endicor.com/zope/test/Calendar

Those of you with Palm Pilots will find the interface familar :-)

The sample page is generated with this source:

	<!--#var standard_html_header-->
	 <!--#calendar-->
	  <!--#var "_.string.upper(mode[0])"-->:
	  <!--#var date fmt=Date-->
	 <!--#/calendar-->
	<!--#var standard_html_footer-->

The chunk of code within the calendar tag is used to render the
individual cells in the calendar display.  It's called for each cell
with the name 'date' bound to the date to be displayed, and 'mode' bound
to either 'day', 'week', or 'month' depending on what mode the calendar
display is in. 

The calendar tag takes a few optional arguments, including mode to start
in (defaults to 'month') and an expression to compute the date to start
on (default to current date if unspecified).

Anyway, have a look. If you think it'd be useful to you, let me know!