The event_form_date() function takes a timestamp and returns a set of textfields and popups showing the day, month, year, hours and minutes. Version 1.215 of event.module doesn't show the correct month, at least with PHP 5.2.0.0 on Windows.

The reason is that the _event_date() function returns a string representation of the date (such as '02' for February). This is used as the #default_value for the month popup, but the #options for that popup are indexed with integers (2 for February).

One fix is to change the following line in event_form_date() from:

'#default_value' => _event_date('m', $timestamp, $offset),

to:

'#default_value' => (int) _event_date('m', $timestamp, $offset),

Comments

bexecho’s picture

Or alternatively use the PHP date format to just get the month without leading zeros.

'#default_value' => _event_date('n', $timestamp, $offset),
killes@www.drop.org’s picture

Status: Active » Fixed

has been fixed

Anonymous’s picture

Status: Fixed » Closed (fixed)