
The JCalendar and HTML sitemap community forum! |
Please log in or register. The date and time is now September 6, 2010, 01:00:01 PM
|
|
|
|
|  |
zed Newbie

JCalendar is great! Posts: 1
|
How to add JCalendar (December 26, 2009, 04:01:29 PM) |
|
Hi All My first time here, I'm not sure how many times this question has been asked? How do I add JCalendar into my programm??? I'm writting an appointment programm that a click on day/date would display another interface to add notes for that day. Many thanks Zed
|
Status: logged off |
|
| Order of replies: first reply last :: first reply first |
ripcuals Newbie

i dont know how to use jCalendar Posts: 1
|
RE: How to add JCalendar (January 9, 2010, 06:02:42 AM) |
|
quote:
Hi All My first time here, I'm not sure how many times this question has been asked? How do I add JCalendar into my programm??? I'm writting an appointment programm that a click on day/date would display another interface to add notes for that day. Many thanks Zed
|
yes mee too i dont know how to put this into my prog. can any of you here tell us how? i want the top part of the calendar. as in i dont want to show the properties and stuff. just simple calendar will do. but i dont know how. as im quite new to programming. thanks alot!
|
Status: logged off |
|
ts89 Newbie

JCalendar is great! Posts: 2
|
RE: How to add JCalendar (February 25, 2010, 09:01:04 AM) |
|
Hi,
seems that no one helps on this forum... i also tried posting this question.. but then struggled myself and managed to do it myself
I only know how to add it to netbeans.. so if u r using netbeans then i can tell u...
|
Status: logged off |
|
donaldjeo Newbie

JCalendar is great! Posts: 1
|
RE: How to add JCalendar (May 12, 2010, 08:19:46 AM) |
|
While working on a Drupal based project where we needed a date picker for our forms, my good friend, and old drupaler, Gerhard, recommended me taking a look at Ted Serbinski's jCalendar, a jQuery based calendar.
I started hacking a quick version of jcalendar.module using some ideas of the very helpful jscalendar.module, which uses the jsCalendar javascript library, like using a special CSS class called via #attribute in the form element array to convert textfields into jcalendar enabled.
The jcalendar module uses hook_form_alter() to look for textfields with the add-jcalendar class, I had to use something different than jcalendar which is used later on the generated form elements by the jQuery code.
This is a sample of how to enable jcalendar from one of your textfields once you've installed the module:
// Define a range of years to show $years = array('0' => 0) + drupal_map_assoc(range(2007,2020));
$plot_dates = array( '2008-11-03', '2007-04-01', '2007-06-11', ); // YYYY-MM-DD
$form['firstdate'] = array( '#type' => 'textfield', '#title' => 'The first date', '#default_value' => '2007-09-29', '#weight' => -20, '#attributes' => array('class' => 'add-jcalendar'), '#jcalendar_year_range' => $years, '#jcalendar_plot_dates' => $plot_dates, '#description' => t('YYYY-MM-DD'), );</code>
The #jcalendar_year_range custom property allows you to provide a range of years, look at the associative array $years, to show in the calendar. If the property is not passed jcalendar.module defaults to the current year plus 20.
#jcalendar_plot_dates, which is not working yet, should allow passing an array of dates to the calendar to plot. I'm not sure if this should be the job of the Drupal module or jCalendar's jQuery code.
This first version of jcalendar.module works, it converts your textfield to three select boxes, day, month, year, and a nice table based date picker, easy to theme via CSS, and once you have the right date you can do whatever you want with it. The original textfield is removed later so your form validation and processing functions should consider if jcalendar is enabled (a simple if (module_exists('jcalendar'))) to handle form elements in a different way.
So, what's the catch? Unfortunately, after I finished my tests and added a second date textfield to my form, I needed to choose a start date and an end date, then I realized jcalendar is duplicating its job for each textfield, it seems the jQuery code only supports one jcalendar per web page. I still need to review the comments in Ted's blog and talk to him to confirm this but I thought it would be a good idea posting what I've done so far in case any of you want to play with the code and improve it.
So here it is, download jcalendar.module and let us know if you get a way to work with more than one calendar per page or alternate ways to alter the original forms.
|
Status: logged off |
|
katejohn Newbie

JCalendar is great! Posts: 1
|
RE: How to add JCalendar (June 24, 2010, 02:20:03 PM) |
|
Your post is very impressive and informative. I have read it and agree with your views, ideas and opinions becasue it is the demand of the time. I am a web developer and working on a project of article directory, articleworlddb in these days. Therefore i am just putting short views here but after some days i shall go in details and provide complete information regarding the topic. Moreover i want to add some interesting things in my article directory as well.
|
Status: logged off |
|
Karachi123 Newbie

JCalendar is great! Posts: 1
|
RE: How to add JCalendar (June 25, 2010, 02:07:18 PM) |
|
Thanks for the solution.
|
Status: logged off |
|
danieljones2006 Newbie

JCalendar is great! Posts: 1
|
RE: How to add JCalendar (September 4, 2010, 04:27:20 PM) |
|
Yes the solution you have mentioned works fine. I tried it an it works fine. Thanks a lot.
|
Status: logged off |
|
|
|
|
 |
Software PBLang 4.67.16.a © 2002-2006 by Martin Senftleben & the PBLang-Team

|
|