You are here

README.txt in Date 6

Drupal date_popup.module README.txt
==============================================================================

Javascript popup calendar and timeentry using the 
jquery UI calendar and jquery-timeentry libraries,

Read the instructions in the /lib/ folder for 
where to find and download the jquery libraries.

==================================================================================
Usage
==================================================================================

To include a popup calendar in a form, use the type 'date_popup':

  $form['date'] = array(
    '#type' => 'date_popup':
    '#title => t('My Date'),
    ....
  );

Set the #type to date_popup and fill the element #default_value with
a date adjusted to the proper local timezone, or leave it blank.

The element will create two textfields, one for the date and one for the
time. The date textfield will include a jQuery popup calendar date picker,
and the time textfield uses a jQuery timepicker.

NOTE - Converting a date stored in the database from UTC to the local zone
and converting it back to UTC before storing it is not handled by this
element and must be done in pre-form and post-form processing!!

==================================================================================
Customization
==================================================================================

To change the default display and functionality of the calendar, set startup
parameters by adding selectors to your element. The configurable options 
are:

#date_type
  The type of date to convert the input value to, DATE_DATETIME, DATE_ISO, or DATE_UNIX

#date_format
  a standard PHP date format string that represents the way the month, day, 
  and year will be displayed in the textfield, like m/d/Y. Months and days 
  must be in the 'm' and 'd' formats that include the zero prefix, the year 
  must be in the 'Y' (four digit) format.

  Any standard separator can be used, '/', '-', '.', or a space.

  The m, d, and Y elements can be in any order and the order will be preserved.

  The time selector will add AM/PM if 'a' is in the format string.

  The default format uses the short site default format.


#date_year_range
  the number of years to go backwards and forwards from current year 
  in year selector, in the format -{years back}:+{years forward},
  like -3:+3

#date_increment
   increment minutes and seconds by this amount, default is 1

==================================================================================
Example:
==================================================================================

$form['date'] = array(
  '#type' => 'date_popup',
  '#default_value' => '2007-01-01 10:30:00,
  '#date_type' => DATE_DATETIME,
  '#date_timezone' => date_default_timezone_name(),
  '#date_format' => 'm/d/Y - H:i',
  '#date_increment' => 1,
  '#date_year_range' => '-3:+3',
);

==================================================================================
Localization
==================================================================================

The module will use the t() function for abbreviated month names, abbreviated 
day names, and the words 'Today', 'Clear', 'Close', 'Prev', and 'Next'. 

The module will use the site default for the first day of the week.

File

date_popup/README.txt
View source
  1. Drupal date_popup.module README.txt
  2. ==============================================================================
  3. Javascript popup calendar and timeentry using the
  4. jquery UI calendar and jquery-timeentry libraries,
  5. Read the instructions in the /lib/ folder for
  6. where to find and download the jquery libraries.
  7. ==================================================================================
  8. Usage
  9. ==================================================================================
  10. To include a popup calendar in a form, use the type 'date_popup':
  11. $form['date'] = array(
  12. '#type' => 'date_popup':
  13. '#title => t('My Date'),
  14. ....
  15. );
  16. Set the #type to date_popup and fill the element #default_value with
  17. a date adjusted to the proper local timezone, or leave it blank.
  18. The element will create two textfields, one for the date and one for the
  19. time. The date textfield will include a jQuery popup calendar date picker,
  20. and the time textfield uses a jQuery timepicker.
  21. NOTE - Converting a date stored in the database from UTC to the local zone
  22. and converting it back to UTC before storing it is not handled by this
  23. element and must be done in pre-form and post-form processing!!
  24. ==================================================================================
  25. Customization
  26. ==================================================================================
  27. To change the default display and functionality of the calendar, set startup
  28. parameters by adding selectors to your element. The configurable options
  29. are:
  30. #date_type
  31. The type of date to convert the input value to, DATE_DATETIME, DATE_ISO, or DATE_UNIX
  32. #date_format
  33. a standard PHP date format string that represents the way the month, day,
  34. and year will be displayed in the textfield, like m/d/Y. Months and days
  35. must be in the 'm' and 'd' formats that include the zero prefix, the year
  36. must be in the 'Y' (four digit) format.
  37. Any standard separator can be used, '/', '-', '.', or a space.
  38. The m, d, and Y elements can be in any order and the order will be preserved.
  39. The time selector will add AM/PM if 'a' is in the format string.
  40. The default format uses the short site default format.
  41. #date_year_range
  42. the number of years to go backwards and forwards from current year
  43. in year selector, in the format -{years back}:+{years forward},
  44. like -3:+3
  45. #date_increment
  46. increment minutes and seconds by this amount, default is 1
  47. ==================================================================================
  48. Example:
  49. ==================================================================================
  50. $form['date'] = array(
  51. '#type' => 'date_popup',
  52. '#default_value' => '2007-01-01 10:30:00,
  53. '#date_type' => DATE_DATETIME,
  54. '#date_timezone' => date_default_timezone_name(),
  55. '#date_format' => 'm/d/Y - H:i',
  56. '#date_increment' => 1,
  57. '#date_year_range' => '-3:+3',
  58. );
  59. ==================================================================================
  60. Localization
  61. ==================================================================================
  62. The module will use the t() function for abbreviated month names, abbreviated
  63. day names, and the words 'Today', 'Clear', 'Close', 'Prev', and 'Next'.
  64. The module will use the site default for the first day of the week.