[UPDATE: RESOLVED ON MY OWN! YAY!] I've got a date range (start and end date) which I'm using to display a start and end time of an event. However, when the minutes are the same for the start and end time (with differing hours), the first time's minute digits are omitted. See the pic:
I've looked through the settings and I cannot, for the life of me, figure out how to show minutes when the minutes are the same. When I change it to be different minutes, it looks good:
I'm sure it's some simple setting that I'm just missing, somewhere. But I've searched and googled and can't figure it out. Here's my configuration:
And here is that format:
Set to that date type:
Seems fine everywhere.
It's in military time--not sure how to get an AM/PM dropdown. Don't see any options for that, but I haven't really investigated that yet. But that's neither here nor there. I'm hiding the year, month, day in this Add Event form and just using a default value.
The only modules that affect this that I'm using are Date and Date API, as well as Panelizer to display it. I'm using a custom layout with panelizer, but that shouldn't matter.
I actually do have some code in the template.php file that alters a date range, but can't see, as of yet, why that'd be screwing things up:
// template.php
function times_square_date_display_range($variables) {
$date1 = $variables['date1'];
$date2 = $variables['date2'];
//if the same month, omit first num's month
if (substr($date1, 2, -1) == substr($date2, 2, -1)) {
$date1 = substr($date1, 0, 2);
}
$timezone = $variables['timezone'];
$attributes_start = $variables['attributes_start'];
$attributes_end = $variables['attributes_end'];
$show_remaining_days = $variables['show_remaining_days'];
$start_date = '<span class="date-display-start"' . drupal_attributes($attributes_start) . '>' . $date1 . '</span>';
$end_date = '<span class="date-display-end"' . drupal_attributes($attributes_end) . '>' . $date2 . $timezone . '</span>';
// If microdata attributes for the start date property have been passed in,
// add the microdata in meta tags.
if (!empty($variables['add_microdata'])) {
$start_date .= '<meta' . drupal_attributes($variables['microdata']['value']['#attributes']) . '/>';
$end_date .= '<meta' . drupal_attributes($variables['microdata']['value2']['#attributes']) . '/>';
}
// Wrap the result with the attributes.
$output = '<div class="date-display-range">' . t('!start-date - !end-date', array(
'!start-date' => $start_date,
'!end-date' => $end_date,
)) . '</div>';
// Add remaining message and return.
return $output . $show_remaining_days;
}
That's pretty much all the info I have about this.
[UPDATE: It is an error with the if statement at the top of the template.php code. I used this to alter the display of date ranges and had to qualify it more to only affect date ranges, not time ranges. Here's the code for the fix ( skip date outputs with ':' character):
if ( (substr($date1, 2, -1) == substr($date2, 2, -1)) &&
( strpos($date1, ':') !== true ) ) {
$date1 = substr($date1, 0, 2);
}
Can I give myself the bounty? :) ]
node--news.tpl.php
if yes, add template to question.