Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Time of order comments is hardcoded to "g:i:s A" in functions op_order_comments_view_table and op_admin_comments_view_table, in uc_order.order_pane.inc.
This gives incorrect display for countries that are not using US time format.
Correct solutions would be to add a time format in UC settings, or to use the date_format_short value from Drupal settings, and replace the dash with line a break.
Since there is an Ubercart setting for date format, I think that first solution is better.
$data['date'] = array(
'#value' => format_date(
$comment->created,
'custom',
variable_get('uc_date_format_default', 'm/d/Y') .'<\b\r />g:i:s A'),
'#cell_attributes' => array('align' => 'center', 'nowrap' => 'true'),
);
$data['date'] = array(
'#value' => format_date(
$comment->created,
'custom',
variable_get('uc_date_format_default', 'm/d/Y') .'<\b\r />'. variable_get('uc_time_format_default', 'g:i:s A')),
'#cell_attributes' => array('align' => 'center', 'nowrap' => 'true'),
);
Comments
Comment #1
flebas CreditAttribution: flebas commentedChanged category to bug report.
Comment #2
TR CreditAttribution: TR commentedCan you turn this into a patch so others can test it?
Comment #3
TR CreditAttribution: TR commentedTagging
Comment #4
elioshYou can also use hook_tapir_table_alter in a custom module:
Comment #5
TR CreditAttribution: TR commentedMoving to 7.x-3.x.
Comment #6
Island Usurper CreditAttribution: Island Usurper commentedDo we really even need that
<br />
in that particular cell? Someone ought to see if word wrapping handles that well enough to begin with. Then we can just go to the normal short format that Drupal already provides.Comment #7
longwaveRemoved the <br> and the nowrap attribute and used the 'short' date format instead, which looks fine to me.