Skip to content

Commit

Permalink
Adding default date formats.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhedstrom committed Dec 17, 2010
1 parent 728f5ac commit 58ba815
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion volunteer_shifts/volunteer_shifts.module
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,44 @@ function volunteer_shifts_box_form($form_state, $content, $title, $description =
drupal_add_js(drupal_get_path('module', 'volunteer_shifts') . '/volunteer-shifts-box.js');

return $form;
}
}

/**
* Implementations of hook_date_format_types().
*/
function volunteer_shifts_date_format_types() {
return array(
'day' => t('Day'),
'time' => t('Time'),
);
}

/**
* Implementation of hook_date_formats().
*/
function volunteer_shifts_date_formats() {
$condensed = array(
'day' => array(
'j F Y',
'l, M j',
'l, j M',
'n/j/Y',
),
'time' => array(
'g:ia',
'H:i',
'g:ia T',
),
);
$formats = array();
foreach ($condensed as $type => $f) {
foreach ($f as $format) {
$formats[] = array(
'type' => $type,
'format' => $format,
'locales' => array(),
);
}
}
return $formats;
}

0 comments on commit 58ba815

Please sign in to comment.