From 0a918eea7238f1dd9e4c4e39ff4a7e98d1c40adc Mon Sep 17 00:00:00 2001 From: Cerdic <cedric@yterium.com> Date: Sat, 2 Aug 2014 10:32:34 +0000 Subject: [PATCH] =?UTF-8?q?Report=20de=20r21477=20:=20Correction=20de=20af?= =?UTF-8?q?fdate=5Fdebut=5Ffin=20pour=20satisfaire=20les=20tests=20http://?= =?UTF-8?q?zone.spip.org/trac/spip-zone/changeset/83995/=5Fcore=5F/tests?= =?UTF-8?q?=20+=20Ferme=20#3218=20:=20utiliser=20la=20date=5Fjour=5Fcourt?= =?UTF-8?q?=20sur=20la=20date=20de=20fin=20si=20on=20a=20pas=20forc=C3=A9?= =?UTF-8?q?=20l'affichage=20de=20l'annee=20(nicod)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/inc/filtres.php | 12 ++++++++---- ecrire/lang/spip_fr.php | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ecrire/inc/filtres.php b/ecrire/inc/filtres.php index 5a5cfe75c0..b8fb73b33e 100644 --- a/ecrire/inc/filtres.php +++ b/ecrire/inc/filtres.php @@ -1589,6 +1589,10 @@ function affdate_heure($numdate) { * @param string $date_fin * @param string $horaire * @param string $forme + * abbr pour afficher le nom du jour en abbrege (Dim. au lieu de Dimanche) + * annee pour forcer l'affichage de l'annee courante + * jour pour forcer l'affichage du nom du jour + * hcal pour pour avoir un markup microformat abbr * @return string * Texte de la date */ @@ -1627,7 +1631,7 @@ function affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme=''){ }else{ // Le <abbr...>lundi 20 fevrier de 18h00</abbr> a <abbr...>20h00</abbr> if($dtabbr && $dtstart && $dtend) - $s = spip_ucfirst(_T('date_fmt_jour_heure_debut_fin_abbr',array('jour'=>$s,'heure_debut'=>$hd,'heure_fin'=>$hf,'dtstart'=>$dtstart,'dtend'=>$dtend,'dtabbr'=>$dtabbr))); + $s = _T('date_fmt_jour_heure_debut_fin_abbr',array('jour'=>spip_ucfirst($s),'heure_debut'=>$hd,'heure_fin'=>$hf,'dtstart'=>$dtstart,'dtend'=>$dtend,'dtabbr'=>$dtabbr)); // Le lundi 20 fevrier de 18h00 a 20h00 else $s = spip_ucfirst(_T('date_fmt_jour_heure_debut_fin',array('jour'=>$s,'heure_debut'=>$hd,'heure_fin'=>$hf))); @@ -1644,7 +1648,7 @@ function affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme=''){ if(!$h) $date_debut = jour($d); else - $date_debut = $affdate($d); + $date_debut = affdate_jourcourt($d,date("Y",$date_fin)); $date_fin = $affdate($f); if($jour){ $nomjour_debut = nom_jour($d,$abbr); @@ -1662,8 +1666,8 @@ function affdate_debut_fin($date_debut, $date_fin, $horaire = 'oui', $forme=''){ $s = _T('date_fmt_periode',array('date_debut' => $date_debut,'date_fin'=>$date_fin)); } else { - $date_debut = affdate($d); - $date_fin = affdate($f); + $date_debut = affdate_jourcourt($d,date("Y",$date_fin)); + $date_fin = $affdate($f); if($jour){ $nomjour_debut = nom_jour($d,$abbr); $date_debut = _T('date_fmt_jour',array('nomjour'=>$nomjour_debut,'jour' => $date_debut)); diff --git a/ecrire/lang/spip_fr.php b/ecrire/lang/spip_fr.php index f35e043802..ed1cf51bea 100644 --- a/ecrire/lang/spip_fr.php +++ b/ecrire/lang/spip_fr.php @@ -108,8 +108,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array( 'date_fmt_heures_minutes_court' => '@h@h@m@', 'date_fmt_jour' => '@nomjour@ @jour@', 'date_fmt_jour_heure' => '@jour@ Ã @heure@', - 'date_fmt_jour_heure_debut_fin' => 'le @jour@ de @heure_debut@ Ã @heure_fin@', - 'date_fmt_jour_heure_debut_fin_abbr' => 'le @dtstart@@jour@ de @heure_debut@@dtabbr@ Ã @dtend@@heure_fin@@dtabbr@', + 'date_fmt_jour_heure_debut_fin' => '@jour@ de @heure_debut@ Ã @heure_fin@', + 'date_fmt_jour_heure_debut_fin_abbr' => '@dtstart@@jour@ de @heure_debut@@dtabbr@ Ã @dtend@@heure_fin@@dtabbr@', 'date_fmt_jour_mois' => '@jour@ @nommois@', 'date_fmt_jour_mois_annee' => '@jour@ @nommois@ @annee@', 'date_fmt_mois_annee' => '@nommois@ @annee@', -- GitLab