You are here

README.txt in Javascript Tools 5

Drupal jscalendar.module README.txt
==============================================================================

Produces DHTML popup calendars using the jscalendar library,

http://www.dynarch.com/projects/calendar/


Requirements
------------------------------------------------------------------------------
This module is written for Drupal 5.0.


Installation
------------------------------------------------------------------------------
Create a directory modules/jscalendar (or, for easy updating, 
modules/jstools/jscalendar) and copy all the module's files into it, as well 
as the folder 'lib' and its contents. Enable the module via the 
administer > modules page.


Developer usage
------------------------------------------------------------------------------

Adding to a textfield
----------------------

To include a jscalendar popup with a textfield, just add the class 'jscalendar':

  $form['date'] = array(
    '#type' => 'textfield',
    '#attributes' => array('class' => 'jscalendar'),
  );


Customization
----------------------

To change the default display and functionality of the calendar, set startup
parameters by adding selectors to your element. The three configurable options 
are 'ifFormat' (the format of the date/time written to the text field), 
'showsTime' (boolean: should time be displayed on the calendar), and 
'timeFormat' (values of '12' for 12-hour clock, which is the default, or '24'
for 24-hour clock).

Example:
  $form['date'] = array(
    '#type' => 'textfield',
    '#attributes' => array('class' => 'jscalendar'),
    // Use only year, month, and day in textfield.
    '#jscalendar_ifFormat' => '%Y-%m-%d',
    // Don't show time.
    '#jscalendar_showsTime' => 'false',
    // Show 24-hour clock.
    '#jscalendar_timeFormat' => '24',
  );


Localization
----------------------

Jscalendar comes with numerous localization files, see the /lib/lang directory.
By default, the module will look at the current Drupal $locale and load an
appropriate localization file, defaulting to 'en' for unsupported languages.
To explicitly set the localization file to be used, call jscalendar_load() with
your desired localization as the argument. Example:

jscalendar_load('it');

File

jscalendar/README.txt
View source
  1. Drupal jscalendar.module README.txt
  2. ==============================================================================
  3. Produces DHTML popup calendars using the jscalendar library,
  4. http://www.dynarch.com/projects/calendar/
  5. Requirements
  6. ------------------------------------------------------------------------------
  7. This module is written for Drupal 5.0.
  8. Installation
  9. ------------------------------------------------------------------------------
  10. Create a directory modules/jscalendar (or, for easy updating,
  11. modules/jstools/jscalendar) and copy all the module's files into it, as well
  12. as the folder 'lib' and its contents. Enable the module via the
  13. administer > modules page.
  14. Developer usage
  15. ------------------------------------------------------------------------------
  16. Adding to a textfield
  17. ----------------------
  18. To include a jscalendar popup with a textfield, just add the class 'jscalendar':
  19. $form['date'] = array(
  20. '#type' => 'textfield',
  21. '#attributes' => array('class' => 'jscalendar'),
  22. );
  23. Customization
  24. ----------------------
  25. To change the default display and functionality of the calendar, set startup
  26. parameters by adding selectors to your element. The three configurable options
  27. are 'ifFormat' (the format of the date/time written to the text field),
  28. 'showsTime' (boolean: should time be displayed on the calendar), and
  29. 'timeFormat' (values of '12' for 12-hour clock, which is the default, or '24'
  30. for 24-hour clock).
  31. Example:
  32. $form['date'] = array(
  33. '#type' => 'textfield',
  34. '#attributes' => array('class' => 'jscalendar'),
  35. // Use only year, month, and day in textfield.
  36. '#jscalendar_ifFormat' => '%Y-%m-%d',
  37. // Don't show time.
  38. '#jscalendar_showsTime' => 'false',
  39. // Show 24-hour clock.
  40. '#jscalendar_timeFormat' => '24',
  41. );
  42. Localization
  43. ----------------------
  44. Jscalendar comes with numerous localization files, see the /lib/lang directory.
  45. By default, the module will look at the current Drupal $locale and load an
  46. appropriate localization file, defaulting to 'en' for unsupported languages.
  47. To explicitly set the localization file to be used, call jscalendar_load() with
  48. your desired localization as the argument. Example:
  49. jscalendar_load('it');