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

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

[elpa] externals/gited 54fb489 10/73: gited-mark-branches-by-date: Provi


From: Stefan Monnier
Subject: [elpa] externals/gited 54fb489 10/73: gited-mark-branches-by-date: Provide defaults to HH:MM:SS.
Date: Sun, 29 Nov 2020 00:00:29 -0500 (EST)

branch: externals/gited
commit 54fb4898000ddccf04ad4d559755317647e787cf
Author: Tino Calancha <tino.calancha@gmail.com>
Commit: Tino Calancha <tino.calancha@gmail.com>

    gited-mark-branches-by-date: Provide defaults to HH:MM:SS.
    
    This avoid `encode-time' signals an error if one of HH, MM or SS is
    missing.
    * gited.el (gited-mark-branches-by-date): Default MM:MM:SS to 00:00:00.
---
 gited.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/gited.el b/gited.el
index 0a66f14..648271e 100644
--- a/gited.el
+++ b/gited.el
@@ -10,9 +10,9 @@
 ;; Compatibility: GNU Emacs: 24.4
 ;; Version: 0.2.0
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
-;; Last-Updated: Tue Jun 06 20:00:22 JST 2017
+;; Last-Updated: Tue Jun 06 20:23:05 JST 2017
 ;;           By: calancha
-;;     Update #: 642
+;;     Update #: 643
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
@@ -2783,11 +2783,18 @@ MIN-TIME must be a string suitable for `date-to-time' 
like
                              " branches with last commit after time: ")
                      default)))
      (list min-time (and prefix ?\s))))
-  (let ((gited-marker-char (or marker-char gited-marker-char)))
+  (let ((gited-marker-char (or marker-char gited-marker-char))
+        (time (funcall (lambda (x) ; Default HH:MM:SS to 00:00:00.
+                         (setq x (parse-time-string x))
+                         (or (car x) (setf (car x) 0))
+                         (or (cadr x) (setf (cadr x) 0))
+                         (or (cadr (cdr x)) (setf (cadr (cdr x)) 0))
+                         (apply 'encode-time x))
+                       min-time)))
     (gited-mark-if
      (and (not (eolp))
           (let ((commit-time (date-to-time (gited-get-date))))
-            (time-less-p (date-to-time min-time) commit-time)))
+            (time-less-p time commit-time)))
      "matching branch")))
 
 (defun gited-mark-branches-containing-regexp (regexp &optional marker-char 
days)



reply via email to

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