Mishoo JSCalendar: A pop-up calendar for use in TWiki forms and TWiki applications
<--
PLEASE DO NOT EDIT THIS TOPIC
It is automatically generated from the subversion repository, and any changes
you make will simply be overwritten the next time a release is generated.
Instead, you could check your fix in, raise a bug in the Bugs web, or mail thge author.
-->
This is the simplest way to use calendars from a plugin.
$name is the name of the CGI parameter for the calendar (it should be unique),
$value is the current value of the parameter (may be undef)
$format is the format to use (optional; the default is set in configure). The HTML returned will display a date field and a drop-down calendar.
\%options is an optional hash containing base options for the textfield.
Example:
Changed:
< <
addHEAD( $setup )
> >
use TWiki::Contrib::JSCalendarContrib;
Added:
> >
...
my $fromDate = TWiki::Contrib::JSCalendarContrib::renderDateForEdit(
'from', '1 April 1999');
my $toDate = TWiki::Contrib::JSCalendarContrib::renderDateForEdit(
'to', undef, '%Y');
Changed:
< <
that can automatically add the required headers to the page being rendered. $setup is the name of the calendar setup module; it can either be ommitted, in which case the method described in the Mishoo documentation can be used to create calendars, or it can be 'twiki', in which case a helper function is added that simplifies using calendars to set a value in a text field. For example,
This function will automatically add the headers for the calendar to the page
being rendered. It's intended for use when you want more control over the
formatting of your calendars than renderDateForEdit affords. $setup is
the name of
the calendar setup module; it can either be omitted, in which case the method
described in the Mishoo documentation can be used to create calendars, or it
can be 'twiki', in which case a Javascript helper function called
'showCalendar' is added that simplifies using calendars to set a value in a
text field. For example, say we wanted to display the date with the calendar
icon before the text field, using the format %Y %b %e
Changed:
< <
# Add styles and javascript for the calendar
require TWiki::Contrib::JSCalendarContrib;
if( $@ || !$TWiki::Contrib::JSCalendarContrib::VERSION ||
> >
# Add styles and javascript for the calendar
use TWiki::Contrib::JSCalendarContrib;
...
Deleted:
< <
$TWiki::Contrib::JSCalendarContrib::VERSION < 0.961 ) {
TWiki::Func::writeWarning('JSCalendarContrib >=0.961 not found '.$@);
} else {
TWiki::Contrib::JSCalendarContrib::addHEAD( 'twiki' );
}
The first parameter to showCalendar is the id of the textfield. See the Mishoo documentation for details of the '$e %B %Y' parameter.
> >
The first parameter to showCalendar is the id of the textfield, and the second parameter is the . See the Mishoo documentation for details of the '$e %B %Y' parameter.
Changed:
< <
Note that the header will only be added once, regardless of the number of times that addHEAD is called.
> >
addHEAD can be called from commonTagsHandler for adding the header to all pages, or from beforeEditHandler just for edit pages etc.
Deleted:
< <
addHEAD can be called from commonTagsHandler for adding the header to all pages, or to beforeEditHandler just for edit pages etc.
Deleted:
< <
Settings
Name of the perl package
Set STUB = TWiki::Contrib::JSCalendarContrib
What do I do
Set SHORTDESCRIPTION = Mishoo JSCalendar, packaged for use by plugins, skins and add-ons.
Added:
> >
Using the Calendar in user forms
You can also use the calendar directly in your own hand-built forms, without
having to write any code. Just add this inline in the topic text:
%INCLUDE{"%SYSTEMWEB%/JSCalendarContribInline"}%
Then, to display a calendar icon next to a text input field:
If the contrib is installed, you will see such a field here:
<--
Set SHORTDESCRIPTION = Mishoo JSCalendar, packaged for use by plugins, skins and add-ons.
-->
Installation Instructions
Added:
> >
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.
Changed:
< <
Download the archive from the Plugins web (see below)
Unpack it in your twiki installation directory. Content:
Add a renderFormFieldForEditHandler so other plugins can forward to this handler to add the date field to the TWikiForms. (TWiki:Main.ThomasWeigert)
10247
Item2054 put the calendar at z-index 2000, way above pattern skin divs.
6634
Item453 removed EditTablePlugins private copy of the Mishoo JS calendar, and made sure it works with JSCalendarContrib. Improved the documentation of the JSCalendar while I was there.
Bugs:Item4030 Added doc for using the calendar in user forms
13603
Bugs:Item2982 cleaned up the interface to the contrib, re-added a date rendering function with a more generic interface
11594
Allow format to be configured.
11415
Add a renderFormFieldForEditHandler so other plugins can forward to this handler to add the date field to the TWikiForms. (TWiki:Main.ThomasWeigert)
10247
Bugs:Item2054 put the calendar at z-index 2000, way above pattern skin divs.
6634
Bugs:Item453 removed EditTablePlugins private copy of the Mishoo JS calendar, and made sure it works with JSCalendarContrib. Improved the documentation of the JSCalendar while I was there.