[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote edda750506 04/11: Handle nil date in front matte
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote edda750506 04/11: Handle nil date in front matter date functions |
Date: |
Mon, 16 Dec 2024 03:58:29 -0500 (EST) |
branch: externals/denote
commit edda7505063be6c1faea05c3a51faddbe1de06f9
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Handle nil date in front matter date functions
---
denote.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/denote.el b/denote.el
index 85867ea2d3..7f17136726 100644
--- a/denote.el
+++ b/denote.el
@@ -2243,26 +2243,30 @@ which case it is not added to the base file name."
;; package: <https://github.com/kaushalmodi/ox-hugo>.
(defun denote-date-rfc3339 (date)
"Format DATE using the RFC3339 specification."
- (replace-regexp-in-string
- "\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\'" "\\1:\\2"
- (format-time-string "%FT%T%z" date)))
+ (if date
+ (replace-regexp-in-string
+ "\\([0-9]\\{2\\}\\)\\([0-9]\\{2\\}\\)\\'" "\\1:\\2"
+ (format-time-string "%FT%T%z" date))
+ ""))
(defun denote-date-org-timestamp (date)
"Format DATE using the Org inactive timestamp notation."
- (format-time-string "[%F %a %R]" date))
+ (if date
+ (format-time-string "[%F %a %R]" date)
+ ""))
(defun denote-date-iso-8601 (date)
"Format DATE according to ISO 8601 standard."
- (format-time-string "%F" date))
+ (if date
+ (format-time-string "%F" date)
+ ""))
(defun denote--format-front-matter-date (date file-type)
"Expand DATE in an appropriate format for FILE-TYPE."
(let ((format denote-date-format))
(cond
- ((null date)
- "")
(format
- (format-time-string format date))
+ (if date (format-time-string format date) ""))
((when-let* ((fn (denote--date-value-function file-type)))
(funcall fn date)))
(t
- [elpa] externals/denote updated (2ab74c1d47 -> c6bc62d6c9), ELPA Syncer, 2024/12/16
- [elpa] externals/denote edda750506 04/11: Handle nil date in front matter date functions,
ELPA Syncer <=
- [elpa] externals/denote 119624e038 03/11: Small refactor of denote-directory-files, ELPA Syncer, 2024/12/16
- [elpa] externals/denote f11966e642 07/11: Add check in denote--get-all-used-ids, ELPA Syncer, 2024/12/16
- [elpa] externals/denote 5541eebbb9 06/11: Use denote-file-has-supported-extension-p instead of denote-filename-is-note-p, ELPA Syncer, 2024/12/16
- [elpa] externals/denote c6bc62d6c9 11/11: Document the optional use of Obsidian-style front matter, ELPA Syncer, 2024/12/16
- [elpa] externals/denote f6fe1e27e6 08/11: Merge pull request #497 from jeanphilippegg/some-changes, ELPA Syncer, 2024/12/16
- [elpa] externals/denote 3ca5797934 05/11: Add denote-file-is-in-denote-directory-p, ELPA Syncer, 2024/12/16
- [elpa] externals/denote ee8b53b5c9 02/11: Use denote-file-has-denoted-filename-p in fontification, ELPA Syncer, 2024/12/16
- [elpa] externals/denote af8279fba4 10/11: Merge branch 'obsidian-file-type', ELPA Syncer, 2024/12/16
- [elpa] externals/denote 05edc7dc5e 01/11: Make it possible to rewrite the front matter even if file name is unchanged, ELPA Syncer, 2024/12/16
- [elpa] externals/denote 2f1a221f5d 09/11: Define the markdown-obsidian front matter in denote-md-extras.el, ELPA Syncer, 2024/12/16