Page 1 of 1

Setting date format for Australia

Posted: Thu Jul 10, 2025 10:41 pm
by frankl
I want to display short dates in admin as d/m/Y

In english.php I had

Code: Select all

setlocale(LC_ALL, ['en_AU.UTF-8', 'en_AU.UTF8', 'ena_au']);

$long_date_formatter = new IntlDateFormatter('en', IntlDateFormatter::FULL, IntlDateFormatter::NONE);
$short_date_formatter = new IntlDateFormatter('en', IntlDateFormatter::SHORT, IntlDateFormatter::NONE);
$date_time_formatter = new IntlDateFormatter('en', IntlDateFormatter::SHORT, IntlDateFormatter::LONG);
However short dates (i.e. on admin/customers.php) dates were shown as m/d/y

Changing IntlDateFormatter locale to en_AU fixed it.

Code: Select all

setlocale(LC_ALL, ['en_AU.UTF-8', 'en_AU.UTF8', 'ena_au']);

$long_date_formatter = new IntlDateFormatter('en_AU', IntlDateFormatter::FULL, IntlDateFormatter::NONE);
$short_date_formatter = new IntlDateFormatter('en_AU', IntlDateFormatter::SHORT, IntlDateFormatter::NONE);
$date_time_formatter = new IntlDateFormatter('en_AU', IntlDateFormatter::SHORT, IntlDateFormatter::LONG);
Set in includes/languages/english.php and admin/includes/languages/english.php

Re: Setting date format for Australia

Posted: Fri Jul 11, 2025 7:13 am
by heatherbell

Re: Setting date format for Australia

Posted: Tue Jul 15, 2025 4:24 am
by MyGamesShop
Moocho grassyass!!! I missed those three lines in some update :)

Now show me how to make the product price in admin always show as:

Products Price (Gross) 100.00 instead of Products Price (Gross) 100
and
Products Price (Net) 100.00 instead of Products Price (Net) 100.0000

I set 'Tax Decimal Places' to 2
Australian Dollar (default) AUD 1.00000000 <--- even when I input 1.00

Its just weird. (and thankyou for making many of your addons free btw..)

Re: Setting date format for Australia

Posted: Tue Jul 22, 2025 7:22 am
by frankl
MyGamesShop wrote: Tue Jul 15, 2025 4:24 am Moocho grassyass!!! I missed those three lines in some update :)

Now show me how to make the product price in admin always show as:

Products Price (Gross) 100.00 instead of Products Price (Gross) 100
and
Products Price (Net) 100.00 instead of Products Price (Net) 100.0000

I set 'Tax Decimal Places' to 2
Australian Dollar (default) AUD 1.00000000 <--- even when I input 1.00

Its just weird. (and thankyou for making many of your addons free btw..)
The way Net and Gross are calculated doesn't lend itself well to PHP formatting, hence the weirdness. It's possible to program something, but not worth it in my opinion. Just put up with it :)