The current code checks to see if the date am/pm format variable is set to 0 (indicating a 24 hour time format instead of a 12 hour time format) and figures the hour accordingly.
$node->{$prefix . 'hour'} = variable_get('event_ampm', '0') ? date('H', $timestamp) : date('g', $timestamp);
Harder to see because of the short "if" syntax in use, but a 0 result is "false", therefore it uses the "g" (12 hour) format, instead of the proper "H" (24 hour) format. This results in input validation for event start and end time fields improperly converting PM times into AM before they are stored in the DB and other assorted related problems.
The simple solution is to reverse the H and g, so I've attached a patch that accomplishes that. I'm not using 5.X yet, so I don't know if this is a problem with that version as well.
| Comment | File | Size | Author |
|---|---|---|---|
| event_ampm.patch | 616 bytes | Thomas Sewell |
Comments
Comment #1
simon georges commentedThis version of Event is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.