From 979ab72686a7b1457b2c351cc602afcac7235aa5 Mon Sep 17 00:00:00 2001 From: Jugurtha Bouhadoun Date: Thu, 6 Jun 2024 14:06:31 +0200 Subject: [PATCH 1/2] fix id month --- views/data/data-entry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/data/data-entry.js b/views/data/data-entry.js index e644e7400..04ca34057 100644 --- a/views/data/data-entry.js +++ b/views/data/data-entry.js @@ -25,7 +25,7 @@ function DataEntry({entry: {name, isDirectory, fileInfo}, path}) { const fileDate = fileInfo?.date && new Date(fileInfo.date) const dateSearchRegExp = /^(?\d{4})-(((?\d{2})-(?\d{2}))|(?T[1-4]))$/ const {year, quarter, month, day} = dateSearchRegExp.exec(name)?.groups || {} - const humanDateDirName = year && month && day ? (new Date(year, month, day)).toLocaleString('fr-FR', dateFormatOptions.dateFormatOptionsLongDate) : + const humanDateDirName = year && month && day ? (new Date(year, (month - 1), day)).toLocaleString('fr-FR', dateFormatOptions.dateFormatOptionsLongDate) : year && quarter && `${translatedQuarter[quarter]} ${year}` const humanDirName = humanDateDirName ? `export du ${humanDateDirName}` : translatedName[[...path, name].join('/')] || translatedName[name] From d254afc6d3e20307fb930c33705bdca097665114 Mon Sep 17 00:00:00 2001 From: Jugurtha Bouhadoun Date: Mon, 10 Jun 2024 12:10:32 +0200 Subject: [PATCH 2/2] fix data on init function --- views/data/data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/data/data.js b/views/data/data.js index f1ed305da..784d4cd93 100644 --- a/views/data/data.js +++ b/views/data/data.js @@ -16,7 +16,7 @@ function Data({root, path = [], data: dataRaw = [], config = {}}) { const dataSections = dataRaw.reduce((acc, entry) => { const fileDate = entry.fileInfo?.date && new Date(entry.fileInfo.date) const {year, month, day} = /^(?\d{4})-(?\d{2})-(?\d{2})$/.exec(entry.name)?.groups || {} - const humanDateDirName = year && month && day && (new Date(year, month, day)).toLocaleString('fr-FR', dateFormatOptions.dateFormatOptionsLongDate) + const humanDateDirName = year && month && day && (new Date(year, (month - 1), day)).toLocaleString('fr-FR', dateFormatOptions.dateFormatOptionsLongDate) const finalEntry = { ...entry,