- Patch #329273 by Damien Tournoud: make map_month() happier.

merge-requests/26/head
Dries Buytaert 2008-11-03 09:54:43 +00:00
parent a28f1ad9d2
commit b963755551
1 changed files with 15 additions and 1 deletions

View File

@ -1716,7 +1716,21 @@ function date_validate($form) {
* Helper function for usage with drupal_map_assoc to display month names.
*/
function map_month($month) {
return format_date(gmmktime(0, 0, 0, $month, 2, 1970), 'custom', 'M', 0);
static $months = array(
1 => 'Jan',
2 => 'Feb',
3 => 'Mar',
4 => 'Apr',
5 => 'May',
6 => 'Jun',
7 => 'Jul',
8 => 'Aug',
9 => 'Sep',
10 => 'Oct',
11 => 'Nov',
12 => 'Dec',
);
return t($months[$month]);
}
/**