Verified Commit b4709a19 authored by David Libeau's avatar David Libeau
Browse files

(Trying to) fix date sorting

parent 14626751
......@@ -186,6 +186,9 @@
</section>
<section style="background-color:white">
<h2>Statistiques supplémentaires</h2>
<p>
</p>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Alphabetique</a></li>
......@@ -218,7 +221,7 @@
<table class="stats"><?php
$bdd_sorted=$bdd_last;
usort($bdd_sorted, function($a, $b) {
return date($a["date"]) <=> date($d["date"]);
return DateTime::createFromFormat('d/m/y H:i:s', $a["date"]) <=> DateTime::createFromFormat('d/m/y H:i:s', $b["date"]);
});
foreach($bdd_sorted as $s => $c){
echo('<tr><th><a href="https://www.referendum.interieur.gouv.fr/consultation_publique/8/'.$bdd_sorted[$s]["section"][0].'/'.$bdd_sorted[$s]["section"].'" target="_blank">'.$bdd_sorted[$s]["section"].'</a></th><th><a href="https://www.referendum.interieur.gouv.fr/consultation_publique/8/'.$bdd_sorted[$s]["section"][0].'/'.$bdd_sorted[$s]["section"].'" target="_blank">'.$bdd_sorted[$s]["date"].'</a></th></tr>');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment