emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote d0e76beb01 1/7: Add option denote-date-prompt-us


From: ELPA Syncer
Subject: [elpa] externals/denote d0e76beb01 1/7: Add option denote-date-prompt-use-org-read-date
Date: Sat, 20 Aug 2022 21:57:30 -0400 (EDT)

branch: externals/denote
commit d0e76beb01c3966ad1bfc20c86c857d3e95296a2
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>

    Add option denote-date-prompt-use-org-read-date
---
 denote.el | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/denote.el b/denote.el
index 77470c9cd4..e5fd9cff6f 100644
--- a/denote.el
+++ b/denote.el
@@ -316,6 +316,16 @@ are described in the doc string of `format-time-string'."
   :package-version '(denote . "0.2.0")
   :group 'denote)
 
+(defcustom denote-date-prompt-use-org-read-date nil
+  "Whether to use `org-read-date' in date prompts.
+
+If non-nil, use `org-read-date'.
+
+If nil, input the date as a string, as described in `denote'."
+  :group 'denote
+  :package-version '(denote . "0.6.0")
+  :type 'boolean)
+
 (defcustom denote-templates nil
   "Alist of content templates for new notes.
 A template is arbitrary text that Denote will add to a newly
@@ -1120,9 +1130,11 @@ here for clarity."
 
 (defun denote--date-prompt ()
   "Prompt for date."
-  (read-string
-   "DATE and TIME for note (e.g. 2022-06-16 14:30): "
-   nil 'denote--date-history))
+  (if denote-date-prompt-use-org-read-date
+      (format-time-string "%Y-%m-%d %H:%M:%S" (org-read-date nil t))
+    (read-string
+     "DATE and TIME for note (e.g. 2022-06-16 14:30): "
+     nil 'denote--date-history)))
 
 (defvar denote--subdir-history nil
   "Minibuffer history of `denote--subdirs-prompt'.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]