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

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

[elpa] externals/kubed 37a7fa4cfc: ; Fix datetime formatting for '--sinc


From: ELPA Syncer
Subject: [elpa] externals/kubed 37a7fa4cfc: ; Fix datetime formatting for '--since-time' argument
Date: Wed, 21 Aug 2024 12:58:24 -0400 (EDT)

branch: externals/kubed
commit 37a7fa4cfcf6beb9f2ee195ee8f7ad6e4ad58055
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    ; Fix datetime formatting for '--since-time' argument
    
    * kubed-transient.el
    (kubed-transient-read-date): New function.
    (kubed-transient-logs-for-resource)
    (kubed-transient-logs): Use it.
    * kubed.el (kubed-logs): Correct typo.
    
    See https://github.com/eshelyaron/kubed/issues/5
---
 kubed-transient.el | 13 +++++++++++--
 kubed.el           |  2 +-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/kubed-transient.el b/kubed-transient.el
index 9b50167204..ea204fc0ee 100644
--- a/kubed-transient.el
+++ b/kubed-transient.el
@@ -15,6 +15,15 @@
 (require 'kubed)
 (require 'transient)
 
+(defun kubed-transient-read-date (prompt default _history)
+  "Prompt with PROMPT for a date, defaulting to DEFAULT.
+
+Return an RFC3339 string representation of the selected date."
+  (require 'org)
+  (when (fboundp 'org-read-date)
+    (format-time-string "%Y-%m-%dT%H:%M:%S%:z"
+                        (org-read-date 'with-time t nil prompt default))))
+
 (defun kubed-transient-read-context (prompt _initial-input _history)
   "Prompt with PROMPT for Kubernetes context."
   (kubed-read-context prompt (kubed-local-context)))
@@ -85,7 +94,7 @@ defaults to \"RESOURCEs\"."
          ("-t" "Limit lines" "--tail="
           :prompt "Byte limit: " :reader transient-read-number-N+)
          ("-S" "Since time" "--since-time="
-          :prompt "Since time: " :reader transient-read-date)]
+          :prompt "Since time: " :reader kubed-transient-read-date)]
         ["Switches"
          ("-A" "All containers" "--all-containers")
          ("-f" "Stream logs" "--follow")
@@ -138,7 +147,7 @@ defaults to \"RESOURCEs\"."
     ("-t" "Limit lines" "--tail="
      :prompt "Byte limit: " :reader transient-read-number-N+)
     ("-S" "Since time" "--since-time="
-     :prompt "Since time: " :reader transient-read-date)]
+     :prompt "Since time: " :reader kubed-transient-read-date)]
    ["Switches"
     ("-A" "All containers" "--all-containers")
     ("-f" "Stream logs" "--follow")
diff --git a/kubed.el b/kubed.el
index b1560f602f..6456c6e9d3 100644
--- a/kubed.el
+++ b/kubed.el
@@ -2809,7 +2809,7 @@ argument, also prompt for CONTEXT."
             (when follow '("--follow"))
             (when prefix '("--prefix"))
             (when timestamps '("--timestamps"))
-            (when since (list "--since" since))
+            (when since (list "--since-time" since))
             (when tail (list "--tail" (number-to-string tail)))
             (when limit (list "--limit-bytes" (number-to-string limit)))))
     (display-buffer buf)))



reply via email to

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