|
@@ -1,6 +1,8 @@
|
|
|
import { hierarchy } from 'd3-hierarchy'
|
|
|
|
|
|
|
|
|
+const dateFormatter = new Intl.DateTimeFormat('fr-FR', { month: 'long', year: 'numeric' })
|
|
|
+
|
|
|
export const RELATIONS = [
|
|
|
'parents',
|
|
|
'siblings',
|
|
@@ -32,6 +34,11 @@ export const VARIANT_IDS = Object.fromEntries(
|
|
|
export const SEARCH_KEYS = ['content', 'title', 'preTitle', 'authors']
|
|
|
|
|
|
|
|
|
+export function formatDate (date) {
|
|
|
+ return dateFormatter.format(new Date(date))
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
export function parseNodesQueryParams ({ mode, nodes = [] }) {
|
|
|
let nodebook = typeof nodes === 'string' ? [nodes] : nodes
|
|
|
nodebook = nodebook.map(ids => {
|