What will take 5 minutes to @burt or @ecartz (to name a few), it takes me an hour... so please bear with my modest code.
I tested it only on the index page.
In the include/functions/html_output.php file:
Code: Select all
function formatted_date($format, $date){
if(empty($date)){
$date = date("Y-m-d H:i:s");
} else {
$date = date("Y-m-d H:i:s", $date);
}
$actualdatetime = new DateTime($date);
switch ($format) {
case 'monthletter':
$theformat = 'MMMM';
break;
case 'short':
// '%d/%m/%Y' this is used for strftime()
// d = jour 0 à 31
// m = mois sur 2 chiffres 01 à 12
// Y = année sur 4 chiffres
$theformat = 'dd/M/YYYY';
break;
case '%d/%m/%Y':
// '%d/%m/%Y' this is used for strftime()
// d = jour 0 à 31
// m = mois sur 2 chiffres 01 à 12
// Y = année sur 4 chiffres
$theformat = 'dd/M/YYYY';
break;
case 'long':
// '%A %d %B %Y' this is used for strftime()
// A = nom du jour en lettres
// d = jour 0 à 31
// B = mois en lettres suivant LOCALE
// Y = année sur 4 chiffres
$theformat = 'EEEE dd M YYYY';
break;
default:
echo "not finish ...";
$theformat = 'EEEE dd M YYYY';
}
$fmt = datefmt_create(
LANGUAGE_LOCALE,
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
LANGUAGE_TIMEZONE,
IntlDateFormatter::GREGORIAN,
$theformat
);
$formatted_result = datefmt_format($fmt, $actualdatetime);
return $formatted_result;
}
Code: Select all
const LANGUAGE_LOCALE = 'fr_FR';
const LANGUAGE_TIMEZONE = 'Europe/Paris';
Remplace
Code: Select all
printf(MODULE_CONTENT_CARD_PRODUCTS_HEADING, strftime('%B')); Code: Select all
printf(MODULE_CONTENT_CARD_PRODUCTS_HEADING, formatted_date('monthletter', ''));Remplace
Code: Select all
? strftime($format, $this->timestamp)Code: Select all
? formatted_date($format, $this->timestamp)The result in the index page :