5 replies [Last post]
Mog
Mog's picture
Offline
Internationalizationizer
Joined: 08/16/2007
Juice: 160
Was this information Helpful?

Hi,

In order te get Ubercart better work with other language it would be better to use
variable_get('uc_date_format_default', 'm/d/Y')
than
format_date(something, 'custom', 'm/d/Y')
(use date format in config than custom one)

or perhaps it could be better to use date format set in drupal core config

here is where the custom format date is used

[ubercart\payment\uc_payment\uc_payment.module]
Line 607 :         '#value' => format_date($payment->received, 'custom', 'm/d/Y<b\r>H:i:s'),
Line 746 :                     '!date' => format_date($payment->received, 'custom', 'm/d/Y'))) .'</p>';
[ubercart\payment\uc_payment\uc_payment_payment_method.inc]
Line 243 :         $output = t('Clear Date:') .' '. format_date($check->clear_date, 'custom', 'm/d/Y');
Line 259 :                 . t('Expected clear date:') .'<br />'. format_date($check->clear_date, 'custom', 'm/d/Y');
[ubercart\payment\uc_payment_pack\uc_payment_pack.module]
Line 306 :         $output = t('Clear Date:') .' '. format_date($check->clear_date, 'custom', 'm/d/Y');
Line 322 :                 . t('Expected clear date:') .'<br />'. format_date($check->clear_date, 'custom', 'm/d/Y');
[ubercart\uc_file\uc_file.module]
Line 879 :     $file_link = (!$expiration) ? l(basename($file->filename), 'download/'. $file->fid .'/'. $file->key, $onclick) : ((time() > $expiration) ? basename($file->filename) : l(basename($file->filename), 'download/'. $file->fid .'/'. $file->key, $onclick) .' ('. t('expires on @date', array('@date' => format_date($expiration, 'custom', 'm/d/Y')) .')'));
Line 882 :       array('data' => format_date($file->granted, 'custom', 'm/d/Y'), 'class' => 'date-row', 'id' => 'date-'. $row),
[ubercart\uc_order\uc_order.module]
Line 1134 :         array('data' => format_date($order->created, 'custom', 'm/d/Y'), 'align' => 'center'),
Line 1526 :       array('data' => format_date($order->created, 'custom', 'm/d/Y')),
[ubercart\uc_order\uc_order_order_pane.inc]
Line 499 :         format_date($arg1->created, 'custom', 'm/d/Y'),
Line 507 :               array('data' => format_date($comment->created, 'custom', 'm/d/Y'), 'align' => 'center'),
Line 777 :           $data['date'][] = array('data' => format_date($comment->created, 'custom', 'm/d/Y<\b\r />g:i:s A'), 'align' => 'center', 'nowrap' => 'true');
Line 809 :           $data['date'][] = array('data' => format_date($comment->created, 'custom', 'm/d/Y<\b\r />g:i:s A'), 'align' => 'center', 'nowrap' => 'true', 'valign' => 'top');
[ubercart\uc_reports\uc_reports.module]
Line 588 :     $date = ($args['length'] == 'day') ? format_date($subreport['start'], 'custom', 'm/d/y - D') : format_date($subreport['start'], 'custom', 'm/d/y') .'-'. format_date($subreport['end'], 'custom', 'm/d/y');
Line 588 :     $date = ($args['length'] == 'day') ? format_date($subreport['start'], 'custom', 'm/d/y - D') : format_date($subreport['start'], 'custom', 'm/d/y') .'-'. format_date($subreport['end'], 'custom', 'm/d/y');
Line 588 :     $date = ($args['length'] == 'day') ? format_date($subreport['start'], 'custom', 'm/d/y - D') : format_date($subreport['start'], 'custom', 'm/d/y') .'-'. format_date($subreport['end'], 'custom', 'm/d/y');
[ubercart\uc_store\uc_store.module]
Line 815 :           array('data' => format_date($order->created, 'custom', 'm/d/Y')),

regards.
Mog

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: better internationnal date support (specialy for reports)

So... anywhere the format_date calls use a custom date, you'd want to replace the simple 'm/d/y' with the date format from the display settings? Makes sense to me, just wanted to make sure I'm reading you right.

fredklopper's picture
Offline
Joined: 01/20/2008
Juice: 28
Agree

Hello Ryan,

Yes I also think it should be this way.

With best regards,

Fred Klopper
By the way, übercart rocks!!!!

Mog
Mog's picture
Offline
Internationalizationizer
Joined: 08/16/2007
Juice: 160
Re: Re: better internationnal date support (specialy for reports

Yes, that's right !
Regards.
Mog

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: better internationnal date support (specialy for rep

Alrighty. I'll bookmark this post. I won't be back in the office till Monday (on vacation atm), but I'll post back here when it's committed.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: better internationnal date support (specialy for

Lyle did it. He rocks. Cool