Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Date Picker Plugin | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Line: 187 to 187 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
|
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Date Picker Plugin<-- Contributions to this plugin package are appreciated. Please update this page at http://twiki.org/cgi-bin/view/Plugins/DatePickerPlugin ![]()
Introduction
The DatePickerPlugin handles an input field with a pop-up calendar to select a date for use in TWiki forms and TWiki applications. The plugin is based on the Mishoo JSCalendar
Use Date Picker in TWikiForms
This package adds a
Example form definition:
Use Date Picker in HTML FormsYou can also use the date picker directly in your HTML forms, without having to write any code. Just include this in the topic text: <form action="..."> %DATEPICKER{ name="Start_date" value="2025-03-13" }% <form>This will show an HTML input field named "Start_date" and a button to popup a calendar to select a date.
Test: (this only works if the DatePickerPlugin is installed and enabled)
Detailed Documentation
<--/twistyPlugin twikiMakeVisibleInline-->
Read the Mishoo documentation or visit the demo page for detailed information on using the calendar widget. This plugin includes the following function to make using the calendar easier from other TWiki plugins:
renderForEdit
This is the simplest way to use calendars from a plugin.
Notes:
Example: use TWiki::Plugins::DatePickerPlugin; ... my $fromDate = TWiki::Plugins::DatePickerPlugin::renderForEdit( 'from', '2012-12-31'); my $toDate = TWiki::Plugins::DatePickerPlugin::renderForEdit( 'to', undef, '%Y');
addToHEAD
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 use TWiki::Plugins::DatePickerPlugin; ... sub commonTagsHandler { .... # Add styles and javascript for the date picker & enable 'showCalendar' TWiki::Plugins::DatePickerPlugin::addToHEAD( 'twiki' ); my $cal = CGI::image_button( -name => 'img_datefield', -onclick => "return showCalendar('id_datefield','%Y %b %e')", -src=> TWiki::Func::getPubUrlPath() . '/' . TWiki::Func::getTwikiWebname() . '/DatePickerPlugin/img.gif', -alt => 'Calendar', -align => 'middle' ) . CGI::textfield( { name => 'date', id => "id_datefield" }); .... }
The first parameter to
The
<--/twistyPlugin-->
Installation InstructionsYou do not need to install anything on the browser to use this plugin. These instructions are for the administrator who installs the plugin on the TWiki server. <--/twistyPlugin twikiMakeVisibleInline-->
<--/twistyPlugin-->
Plugin Info
Related Topics: VarDATEPICKER, TWikiPreferences, TWikiForms, TWikiPlugins
|