create new tag
, view all tags

JSCalendarContribDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on JSCalendarContrib contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Feedback on JSCalendarContrib

-- CrawfordCurrie - 30 Aug 2004

Is there a demo for this anywhere? A link that still works?

All I see is argument over whether it shouod be in the core, forced into user topic by putting it in the template.

What I want is to put it in one and only one application specific topic.

-- AntonAylward - 11 Nov 2004

I've gone over the code fragments in JSCalendarContrib and experimented with evreything short of modifying the templates. I've looked at the resulting source and "deomposed" it and checked the URLs and they do point to what they should. The javascript works. I can put it in a %COMMENT and build a %COMMENT template for generating 'correct' entries for the Calendar Plugin.

But I can't get the 'stylesheet' and the colors without putting it in the view template for the skin I'm using.

Why do I have to burden evry topic I view with dowenloading that style sheet whether I'm using the calendar or not?

-- AntonAylward - 20 Nov 2004

Because that was the simplest thing to do when I was packaging the module. If you can find a better way to do it, please feel free!

-- CrawfordCurrie - 20 Nov 2004

I just used this Contrib to make Form use it (and only insert CSS and JS if needed). See JavaScriptDatePickerForForm. Now I need to do the same for EditTablePlugin ...

-- ColasNahaboo - 06 Jan 2005

Crawford, I made some enhancements to the NewContribTemplate and created supporting Contrib topics. With this I changed the Contrib topic text:

  • Heading on top, followed by short description
  • Added TOC
  • Added SHORTDESCRIPTION in "Settings" section
  • Added a note to the "Installation Instructions" section
  • Added link to LGPL in "License" table row
  • Added "Appraisal" table row
  • Turned SharedCode into Interwiki link
  • Fixed heading levels (use level one only once on top)

Could you take that into the next release of the package?

-- PeterThoeny - 22 Mar 2005

Can someone help me with this strange problem? I downloaded the files and added all the lines to twiki.blueskin.tmpl. Everything seems to work as expected except that the popup is very wide (see image below). If I make the browser window wider it does not seem to affect the popup. However if I make is narrower, the calender width shrinks dynamically. I'm completely lost as to how to debug this. It's almost certainly on my side, since everyone else seems to be fine.

I even tried downloading the latest version of the files (v1.0), but it didn't change anything.

Strange calendar behavior

Thanks -- PankajPant - 22 Dec 2005

I had the same problem on Safari, so I updated the calendar script to version 1.0 and put it in SVN(see SVN:7997). Now it runs without problems. When you got the same behaviour on http://www.dynarch.com/projects/calendar/ you should report it there again.

-- AndreUlrich - 29 Dec 2005

Thanks for the tip. I looked at the forums at the above link, and although I didn't spot anything similar, I did discover that the width of the table could be set with .calendar table {width: 400px}.

It turns out that setting the width to a very small number does the trick. I added the following line to calendar.js:

        var table = Calendar.createElement("table");
        this.table = table;
        table.cellSpacing = 0;
        table.cellPadding = 0;
        table.width = "10px";    // new line

I'm posting this here, in case someone else stumbles into it.

-- PankajPant - 29 Dec 2005

You should apply these changes to twiki.js and not calendar.js directly, as updates of the original files would override these settings.

Can you tell me, if the generic examples have on the dynarch site have the same error and if the new version I uploaded to SVN has still the same error?

-- AndreUlrich - 31 Dec 2005

Oops, also here, all my changes are gone. Please check the Dev topic once in a while! Please understand that I am already working many hours a day on open source TWiki and simple cannot allocate more time to mail the author, file a bug or do the doc fixes myself.

-- PeterThoeny - 28 Feb 2006

This contrib is listed in the ContribPackage index page, but there is no indication what it does. The contrib needs a SHORTDESCRIPTION.

-- PeterThoeny - 07 Mar 2006

The calendar popup is hidden within Firefox 1.5, nevertheless the calendar is running from the samples of JSCalendar

The hidden popup occurs first in TWiki-4.0.2 (pattern skin), for Firefox, Opera, Konqueror, etc., looks like a tag mismatch within the skin.

Using MSIE all works fine.

-- RainerRohmfeld - 26 Apr 2006

Please report a bug in Bugs:WebHome web against pattern skin. Thanks.

-- CrawfordCurrie - 27 Apr 2006

Bugs:Item2054 was fixed recently, meaning this contrib is now again working with Firefox and latest PatternSkin.

-- SteffenPoulsen - 19 May 2006

To the maintainer: Could you please add a SHORTDESCRIPTION setting so that the contrib is listed with explanation in the ContribPackage table?

-- PeterThoeny - 20 May 2006

It would be really nice to have a JSCalendarPlugin that allows the use of the calendar in forms... Similar to TwistyContrib and TwistyPlugin

-- JosMaccabiani - 27 Aug 2006

Don't quite understand what you are asking for, as the JSCalendarContrib can (and is) easily (be) used in forms...

-- ThomasWeigert - 27 Aug 2006

OK, then let me ask it this way: I'd like to have a form (not TWikiForm) with a date field, and a calendar icon next to it (link to JSCalendar) that collects the date. How do I make that work? What TWikiML do I use in my topic/form?

-- JosMaccabiani - 28 Aug 2006

I think the EditTablePlugin has that capability.

-- CrawfordCurrie - 29 Aug 2006

Jos, the quick way is to put the following in your topic (just an example):

<LINK TYPE="text/css" rel="stylesheet" href="%PUBURL%/%TWIKIWEB%/JSCalendarContrib/calendar-system.css" />
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/JSCalendarContrib/calendar.js"></script>
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/JSCalendarContrib/lang/calendar-en.js"></script>
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/JSCalendarContrib/twiki.js"></script>
Select Monday of the week of interest:  
<form action="%SCRIPTURL%/view/%WEB%/WeeklyUpdate">
<input type="text" name="date" size="16" id="mydatefieldid"/>
<button type="reset" onclick="return showCalendar('mydatefieldid','%e %b %Y')">
  <img src="%PUBURL%/%TWIKIWEB%/JSCalendarContrib/img.gif" alt="Calendar"/>
<input type="hidden" name="template" value="viewprint" />
<input type="submit" value="Update" />

The slightly longer way is to wait for me to get my computer back up and upload the next version of ControlsPlugin, which has that wrapped in as a macro %DATECONTROL%...

-- ThomasWeigert - 30 Aug 2006

Thomas, that works like a charm! Thanks a million.

-- JosMaccabiani - 30 Aug 2006

When integrating the new JSCalendarContrib with EditTablerowPlugin I noticed that it is rather awkward to leverage this contrib for editing form fields. One needs to define a renderFormFieldForEditHandler, but you cannot easily invoke such handler in JSCalendarContrib, as it is not a plugin. I was trying to figure out how to make it register a handler anyways, but finally gave up and added such handler to EditTablerowPlugin, which just forwards to the real handler in JSCalendarContrib (which I added).

This tells me that JSCalendarContrib should really be a plugin, not a Contrib. Or even better, the date field should be added to FormDotPm.

Uploaded a new version of JSCalendarContrib...

-- ThomasWeigert - 04 Sep 2006

Hi All. After following ThomasWeigert's instructions for using JSCalendarContrib in a regular html form, the calendar popup is still hidden in Firefox, safari, etc. We are using the latest JSCalendarContrib, PatternSkin, and TWiki 4.0.4.

Any suggestions or help would be greatly appreciated. I have reproduced this in JSCalendarTest and opened Bugs:Item2987.

-- DevinBougie - 27 Sep 2006

The new JSCalendarContrib is missing the renderFormFieldForEditHandler subroutine in the JSCalendarContrib.pm file. Without this subroutine, TWiki gives an error when you try to edit a form.

-- AlokNarula - 12 Jan 2007

I found this contrib to be very useful for our Intranet, however we would need to select both a date and a time in some applications. Looking at the Mishoo and JSCalendar documentation I saw the "showsTime:true" option to be set in order to have the time displayed and selectable. Unfortunately I wasn't able to understand how to enable it into the TWiki contrib module (indeed I was able to enable it in a standalone html page). Any suggestion would be greatly appreciated.

-- FabrizioBerdondini - 30 Jan 2007

Just to follow up on the comment from AlokNarula (thanks for that BTW). You will need to use the JSCalendarContrib.pm from the previous release which has the renderFormFieldForEditHandler subroutine defined, otherwise you will get errors like Can't call method "renderForEdit" on unblessed reference when using EditTablerowPlugin and errors complaining that the renderFormFieldForEditHandler subroutine does not exist when editing a page.

-- KeithBurdis - 13 Feb 2007

Shouldn' EditTablerowPlugin be updated in that case?

-- FranzJosefSilli - 13 Feb 2007

The month of November 2007 has an error: shows twice day 3, on Saturday and Sunday

  • error in JSCalendar:

-- CarlinhosCecconi - 31 Oct 2007

TWiki is used internationally. It would be nice if this contrib uses the default ISO format, such as 2007-10-31.

-- PeterThoeny - 01 Nov 2007

It can use whatever format you like; see the documentation for more information in selecting different date formats.

-- CrawfordCurrie - 02 Nov 2007

My point was to ship it so that the default is the ISO date.

-- PeterThoeny - 02 Nov 2007

The error also occurs in the ISO:

  • If the field is empty the error does not happen:

  • But if the field already contain some value the error occurs:

  • The same error on the site www.dynarch.com:

-- CarlinhosCecconi - 06 Nov 2007

Did you report this to the developers of jscalendar too?

-- FranzJosefGigler - 07 Nov 2007

Yes, see http://sourceforge.net/tracker/index.php?func=detail&aid=1823682&group_id=75569&atid=544285

-- CarlinhosCecconi - 07 Nov 2007

When used with edittable, it sometimes happens that the calendar is not visible or not on the screen. Then you need to scroll your document up to search the tool. Is there a solution for this? We use IE7 and latest version of calendar

-- FrederikBeun - 15 Feb 2008

The fact it isn't visible is because people are clicking on the scrollbar, and clicking hides the calendar. The location where the calander appears seems to be the problem. It should be visible on the screen without scrolling. But it always appears at the lowest possible position of the screen (when viewing top of topic)

-- FrederikBeun - 15 Feb 2008

Hi Everyone. Has anyone been able to use more than one JSCalendar per topic? I'm using the JSCalendar as part of the actiontracker comment form, and whenever a user puts more than one per page, it won't pass the date value back to the form field. Initially, it wouldn't pop-up the calendar in the correct location. I fixed that by passing in unique id values for each instance of the calendar, but now the date field won't populate when clicked.

-- DeanSpicer - 31 Mar 2008

I am using multiple date fields in manually crafted forms. the trick is to use unique IDs in the input field and passing those along to the JavaScript function. Example:

<script type='text/javascript' src='%PUBURLPATH%/%TWIKIWEB%/JSCalendarContrib/twiki.js'> </script>
<style type='text/css' media='all'>
    @import url('%PUBURLPATH%/%TWIKIWEB%/JSCalendarContrib/calendar-blue.css');
     .calendar {z-index:2000;}
<script type='text/javascript' src='%PUBURLPATH%/%TWIKIWEB%/JSCalendarContrib/calendar.js'></script>
<script type='text/javascript' src='%PUBURLPATH%/%TWIKIWEB%/JSCalendarContrib/lang/calendar-en.js'> </script>
<link type="text/css" rel="stylesheet" href="%PUBURLPATH%/%TWIKIWEB%/JSCalendarContrib/calendar-system.css"  />
<form name="new" action="%SCRIPTURLPATH{save}%/%WEB%/">
|  Start Date: | <input type="text" name="StartDate" value="" size="12" id="startDateID" /> <button type="reset" onclick="return showCalendar('startDateID','%Y-%m-%d')"> <img src="%PUBURL%/%TWIKIWEB%/JSCalendarContrib/img.gif" alt="Calendar" /> </button> Use format =YYYY-MM-DD= |
|  End Date: | <input type="text" name="EndDate" value="" size="12" id="endDateID" /> <button type="reset" onclick="return showCalendar('endDateID','%Y-%m-%d')"> <img src="%PUBURL%/%TWIKIWEB%/JSCalendarContrib/img.gif" alt="Calendar" /> </button> Use format =YYYY-MM-DD= |

-- PeterThoeny - 01 Apr 2008

The issue identified by FrederikBeun is one with JSCalendar, specific to IE7. A fix is posted here: http://sourceforge.net/tracker/index.php?func=detail&aid=1743970&group_id=75569&atid=544285

-- AdrianHutchinson - 14 May 2008

For what it's worth, the "the Mishoo documentation" and "visit the demo page" links on JSCalendarContrib (both on TWiki.org and in our installation) are broken.

-- DevinBougie - 15 May 2008

Thanks for your response Peter, but my problem is complicated by my use of the comment plugin which acts as an action input form. I use a comment template that looks like:


%TABLE{databg="#ffffff" tableborder="0" cellborder="0"}%
|        <label for="action_who">Action for</label>| <select name="action_who"><option>%WIKINAME%</option> %SEARCH{"%META:FORM.*[U]serForm" web="%MAINWEB%" type="regex" topic="*" casesensitive="on" nosearch="on" nototal="on" format="<option>$topic</option>" sort="topic" excludetopic="Test*, TWiki*" separator=" "}%</option></select> |
|        <label for="action_requester">Action requester</label>| <select name="action_requester"><option>%WIKINAME%</option> %SEARCH{"%META:FORM.*[U]serForm" web="%MAINWEB%" type="regex" topic="*" casesensitive="on" nosearch="on" nototal="on" format="<option>$topic</option>" sort="topic" excludetopic="Test*, TWiki*" separator=" "}%</option></select> |
|        <label for="action_category">Category</label>| <input class="twikiInputField" name="action_category" id="action_category" type="text" size="50" value="%category|---%" /> | 
|        <label for="%calid|action_due%">Due date</label>| <input class="twikiInputField" name="%calid|action_due%" id="%calid|action_due%" type="text" size="30" value="%URLPARAM{"due"}%" /> <input type="image" src="%PUBURL%/%SYSTEMWEB%/JSCalendarContrib/img.gif" onclick="javascript: return showCalendar('%calid|action_due%','%e %B %Y')" /> |
|        <label for="action_priority">Action priority</label>| <select name="action_priority"><option>1</option><option>2</option><option selected>3</option><option>4</option><option>5</option></select> |
|    <label for="action_comment">Description</label>| <textarea %DISABLED% rows="%rows|3%" cols="%cols|50%" name="action_comment" id="action_comment" class="twikiInputField" wrap="soft" onfocus="if(this.value=='%MESSAGE%')this.value=''" onblur="if(this.value=='')this.value='%MESSAGE%'">%MESSAGE%</textarea> |
|| <input %DISABLED% type="submit" class="twikiButton" value="Add action" /> |

%TMPL:DEF{OUTPUT:myaction3}%%POS:BEFORE%%AC%NOP%TION{who="%URLPARAM{"action_who"}%" category="%URLPARAM{"action_category"}%" due="%URLPARAM{"%calid|action_due%"}%" priority="%URLPARAM{"action_priority"}%" requester="%URLPARAM{"action_requester"}%"}% %URLPARAM{"action_comment" newline="<br />"}%<br />- Created by %WIKIUSERNAME%, %SERVERTIME%

And then on a topic I would like to use it twice like the following:

COMMENT{type="myaction3" calid="first"}%

COMMENT{type="myaction3" calid="second"}%

By passing in a "calid" through the comment plugin, the calendars pop-up in the correct locations...but the value picked from the calendar never populates the field.

Any idea what I am doing wrong?

-- DeanSpicer - 11 Jun 2008

I have applied the circulating patch for the IE7 rendering issue. Please download the latest version.

-- ArthurClemens - 10 Sep 2008

I got error messages in my apache log:

[Sat Oct 04 13:51:33 2008] [error] [client] File does not exist: /var/www/twiki/pub/TWiki/JSCalendarContrib/screenshot.gif, referer: http://localhost/twiki/bin/view/TWiki/JSCalendarContrib
I looked in both install-archives (.tgz + .zip), there is no screenshot.gif - I found it only as attachment to TWiki:Plugins.JSCalendarContrib.

btw, CommentPlugin is a little worried about the verbatim-tag - I found this comment in the verbatim-tags of the comment from 11-Jun-2008....

-- WolfgangRaus - 04 Oct 2008

In case someone else needs the undocumented information, to control the format used in form fields with date format, you need to adjust the LocalSite.cfg parameter. For example, to get ISO format, include the following string:

$TWiki::cfg{JSCalendarContrib}{format} = '%Y-%m-%d';
This SHOULD be documented in the released TWiki:Plugins.JSCalendarContrib topic!! (referral to the general DHTML Calendar Widget page DOES NOT address TWiki-specific parameters.)

-- RaymondLutz - 20 Feb 2009

Agreed, this needs to be documented in the contrib topic. Thanks for the hint.

-- PeterThoeny - 21 Feb 2009

This Contrib is essential, but I have a lot of problems with it, primarily because, I believe, its services get requested in different ways by different requestors. If this gets included in a topic more than once, it breaks. So, I was wondering, for perhaps a future release, that things like this Contrib (perhaps this applies to others as well) would be best implemented as a service requested by the plugin or topic. Some kind of a hook in the main code which would get called to include the "JSCalendar" code if requested, a simple boolean or binary, so if there are multiple requests, it only gets added once. Yes, I imagine all the plugins which use JSCalendar would have to be tweaked to accomodate. Yes, it would not protect against someone manually putting the javascript in a topic.

-- AaronLWalker - 2010-05-25

Converting into a plugin is one option. Another one is to call a wrapper Javascript code that loads the actual JSCalendar Javascript conditionally only once.

-- PeterThoeny - 2010-05-26

I suggest to convert this contrib into a plugin and name it DatePickerPlugin. That way one can simply use a %DATEPICKER{ name="start_date" value="2010-12-01" }% to add an HTML input field with a date picker. I have just done that conversion with the ColorPickerContrib / ColorPickerPlugin.

-- PeterThoeny - 2010-12-01

I'll look into converting this into a plugin named DatePickerPlugin.

-- ScottCranston - 2010-12-03

Thank you Scott, this is a good project to get started.

-- PeterThoeny - 2010-12-03

I recommend to use Subversion to manage, build and upload the plugin. See ReadmeFirst and PluginsInSubversion.

-- PeterThoeny - 2010-12-03

New DatePickerPlugin posted. It will replace the JSCalendarContrib.

-- PeterThoeny - 2012-12-10

Topic attachments
I Attachment History Action Size Date Who Comment
GIFgif calendar_shot1.gif r1 manage 33.2 K 2005-12-22 - 18:32 PankajPant Strange calendar behavior
JPEGjpg errorJSCalendar.jpg r1 manage 16.2 K 2007-10-31 - 19:30 CarlinhosCecconi error in JSCalendar
JPEGjpg errorJsCalendar1.jpg r1 manage 15.7 K 2007-11-06 - 15:51 CarlinhosCecconi error in JSCalendar
JPEGjpg errorJsCalendar2.jpg r1 manage 15.9 K 2007-11-06 - 15:52 CarlinhosCecconi error in JSCalendar
JPEGjpg errorJsCalendar3.jpg r1 manage 24.4 K 2007-11-06 - 15:52 CarlinhosCecconi  
Edit | Attach | Watch | Print version | History: r57 < r56 < r55 < r54 < r53 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r57 - 2012-12-10 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.