how to use date popup calendar in event module
Here is a pacth for event module patch to use date popup js calendar for 5.x-1.0:
#note that you need both event and date_popup modules!
--- event.module
+++ (clipboard)
@@ -1923,6 +1923,29 @@
'#description' => t('YYYY-MM-DD HH:MM'),
);
}
+ else if (module_exists('date_popup')) {
+
+ $form['start_date'] = array(
+ '#title' => t('Start Date'),
+ '#type' => 'date_popup',
+ '#default_value' => _event_date('YYYY-MM-DD HH:MM:SS', $node->event_start ? $node->event_start : _event_user_time(), $node->start_offset),
+ '#attributes' => array('class' => 'date_popup'),
+ '#size' => 19,
+ '#maxlength' => 19,
+ '#weight' => -15,
+ '#description' => t('YYYY-MM-DD HH:MM'),
+ );
+ $form['end_date'] = array(
+ '#title' => t('End Date'),
+ '#type' => 'date_popup',
+ '#default_value' => _event_date('Y-m-d H:i', $node->event_end ? $node->event_end : _event_user_time(), $node->end_offset),
+ '#attributes' => array('class' => 'date_popup'),
+ '#size' => 19,
+ '#maxlength' => 19,
+ '#weight' => -15,
+ '#description' => t('YYYY-MM-DD HH:MM'),
+ );
+ }
else {
$form['event_start'] = array(
'#type' => 'fieldset',
| Attachment | Size |
|---|---|
| event.module.patch | 1.23 KB |












Post new comment