We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Date au format français | Forum

Norias
Norias Apr 18 '17

Code à modifier pour passer les dates du format "Oct 25 '16" au format "25 Oct 16"


Ca se passe à partir de la ligne 68 du fichier ow_utilities/date_time.php


Remplacer:


if ( $onlyDate ) 

 { 

   return ( date('y', $timeStamp) === date('y', time()) ) ? 

     $month . strftime(" %e", $timeStamp) : 

     $month . strftime(" %e '%y", $timeStamp);

 } 

return ( date('y', $timeStamp) === date('y', time()) ) ?

     $month . ( $militaryTime ? strftime(" %e, %H:%M", $timeStamp) : strftime(" %e, %I:%M%p", $timeStamp) ) : 

     $month . ( $militaryTime ? strftime(" %e '%y, %H:%M", $timeStamp) : strftime(" %e '%y, %I:%M%p", $timeStamp) );


par :


if ( $onlyDate ) 

 { 

    return ( date('y', $timeStamp) === date('y', time()) ) ?

        strftime("%e ", $timeStamp) . $month : 

        strftime("%e ", $timeStamp) . $month . strftime(" %Y", $timeStamp) ;

 } 

return ( date('y', $timeStamp) === date('y', time()) ) ? 

    ( $militaryTime ? strftime("%e ", $timeStamp) . $month . strftime(", %Hh%M",$timeStamp) : $month . strftime(" %e, %I:%M%p", $timeStamp) ) :

    ( $militaryTime ? strftime("%e ", $timeStamp) . $month . strftime(" %Y, %Hh%M", $timeStamp) : $month . strftime(" %e '%y, %I:%M%p", $timeStamp) );



Ca peut s'adapter aux besoins de chacun suivant les règles de php : http://php.net/manual/fr/function.strftime.php

The Forum post is edited by Norias Sep 18 '19
skaoxine
skaoxine Apr 18 '17
Merci pour l'astuce mais quelle est la différence avec l'option dans la partie administration ?

(en anglais) SETTINGS -> General -> Time settings -> Date format : day/month/year
Norias
Norias Apr 19 '17
Cette option ne change rien, si ? 


J'ai vu plein d'oxwall en français avec les dates au format anglais, et même sur demo.oxwall.org ça ne change rien non plus...




skaoxine
skaoxine Apr 20 '17

L'option "Date format" dans la partie administration change le format de la date de naissance, d'inscription et lors de la création d'un événement qui une fois créer apparaît dans détails au format month/day, pareil pour newsfeed, forum, blog, etc...

%d.%m.%Y : 01.05.2017
%e.%m.%Y : 1.05.2017
%d/%m : 01/05
%d/%m/%y : 20/05/17
...etc...

! Merci !