Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I'm running with 12-hour (am/pm) time and Timezone Handling set to No. My only problem is with times from noon to 12:59pm - they are displayed (and sorted) as am.
Conformed. I also had one person say that their event showed as 11am no matter what time they put in, but when I went in and set it to 3pm, it worked. This is a _critical_ bug that must be fised sooner rather than later - it's effecting live sites and making it very difficult to post events!
I've tweaked my copy of event.module, so I can't provide a patch for just this problem, but here's a version of event_validate() that addresses this problem:
function event_validate(&$node) {
// Re-calculate $node->start if we have all the parameters.
if (isset($node->year) && isset($node->month) && isset($node->day) && isset($node->hour) && isset($node->minute)) {
$hour = $node->hour;
if (variable_get('event_ampm', '0')) {
if ($node->ampm == 'pm') {
if ($hour != 12) $hour += 12;
}
elseif ($hour == 12) {
$hour -= 12;
}
}
$node->start = _event_mktime($hour, $node->minute, 0, $node->month, $node->day, $node->year);
if (variable_get('event_timezone', '1')) {
$node->start -= $GLOBALS['user']->timezone;
}
}
if (empty($node->start)) {
$node->start = time();
// Round to nearest hour:
$node->start -= $node->start % (60 * 60);
}
$fields = event_fields();
foreach ($fields as $field => $def) {
if ($def[2] && empty($node->$field)) {
$error[$field] = t("Required.");
}
}
return $error;
}
Comments
Comment #1
usharf commentedI have the same problem with AM/PM, all hours are treted as AM, event though site is used to diaply 24hrs format.
Comment #2
mikeryanI'm running with 12-hour (am/pm) time and Timezone Handling set to No. My only problem is with times from noon to 12:59pm - they are displayed (and sorted) as am.
Comment #3
seanrConformed. I also had one person say that their event showed as 11am no matter what time they put in, but when I went in and set it to 3pm, it worked. This is a _critical_ bug that must be fised sooner rather than later - it's effecting live sites and making it very difficult to post events!
Comment #4
seanrconfirmed, even. LOL
Comment #5
mikeryanI've tweaked my copy of event.module, so I can't provide a patch for just this problem, but here's a version of event_validate() that addresses this problem:
Comment #6
killes@www.drop.org commentedfixed in 4.6
Comment #7
(not verified) commented