chrono = {
const champs = new Set();
var result = [];
data.forEach((d) => {
const dateEtType = d["Date_et_typologie_de_la_protection"].split(";");
const nom = d.Titre_editorial_de_la_notice;
dateEtType.forEach((e) => {
const date = new Date(e.substring(0, e.indexOf(":")));
const qualif = e.substring(e.indexOf(":") + 1).trim();
champs.add(qualif);
if (qualif.indexOf("class") > -1) {
result.push({ date, nom, type: "classé" });
}
if (qualif.indexOf("inscrit") > -1) {
result.push({ date, nom, type: "inscrit" });
}
});
});
result = result.sort((a, b) => a.date - b.date);
return { result, champs };
}