Previous version made GPDR-friendly

This commit is contained in:
2025-08-18 16:06:37 +02:00
commit fa64b62d5a
357 changed files with 10137 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
// Stolen from https://stackoverflow.com/a/31615643
const appendSuffix = n => {
var s = ['th', 'st', 'nd', 'rd'],
v = n % 100;
return n + (s[(v - 20) % 10] || s[v] || s[0]);
};
export default function dateFilter(value) {
const dateObject = new Date(value);
// const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
const months = [
'janv.',
'févr.',
'mars',
'avr.',
'mai',
'juin',
'juill.',
'août',
'sept.',
'oct.',
'nov.',
'déc.'
];
const dayWithSuffix = appendSuffix(dateObject.getDate());
// return `${dayWithSuffix} ${months[dateObject.getMonth()]} ${dateObject.getFullYear()}`;
return `${dateObject.getDate()} ${
months[dateObject.getMonth()]
} ${dateObject.getFullYear()}`;
}

View File

@@ -0,0 +1,11 @@
import markdownIt from 'markdown-it';
const m = markdownIt({
html: true,
breaks: true,
linkify: true
});
export default function markdown(value) {
return m.render(value);
}

View File

@@ -0,0 +1,5 @@
export default function w3cDate(value) {
const dateObject = new Date(value);
return dateObject.toISOString();
}