From 4fd1a64015e934cef0e48fbdd789fc45c6cfc805 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sun, 24 Sep 2023 10:05:17 +0200 Subject: [PATCH] search created date --- parse_orgmode_to_json.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/parse_orgmode_to_json.mjs b/parse_orgmode_to_json.mjs index 6102569..0e587e8 100644 --- a/parse_orgmode_to_json.mjs +++ b/parse_orgmode_to_json.mjs @@ -318,7 +318,12 @@ fs.readFile(sourceFilePath, 'utf8', function (err, data) { // sans heure: "2022-12-21 mer." convertedDate = moment(dateFound[0], 'YYYY-MM-DD ddd') - } else if (dateFound[0].length === 21) { + } + else if (dateFound[0].length === 19) { + // avec secondes: "2022-11-01 00:44:12" + convertedDate = moment(dateFound[0], 'YYYY-MM-DD HH:mm:ss') + } + else if (dateFound[0].length === 21) { // avec heure: "2022-11-01 mar. 00:44" convertedDate = moment(dateFound[0], 'YYYY-MM-DD ddd HH:mm') }