[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 6267cf7 3/6: Refine passport field string output
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 6267cf7 3/6: Refine passport field string output |
Date: |
Sun, 8 Oct 2017 17:54:11 -0400 (EDT) |
branch: externals/ebdb
commit 6267cf7e6e0ca0bc3375dc775a5c157303cccb73
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Refine passport field string output
* ebdb.el (ebdb-string): The ebdb-string method should also output
issue and expiration dates.
* ebdb-com.el (ebdb-fmt-field): The ebdb-fmt-field method can just do
country and number.
---
ebdb-com.el | 8 ++++++++
ebdb.el | 11 +++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 0723d2e..93a5984 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -464,6 +464,14 @@ property is the field instance itself."
(with-slots (bank-name account-name) field
(format "%s: %s" bank-name account-name)))
+
+(cl-defmethod ebdb-fmt-field ((_fmt ebdb-formatter-ebdb)
+ (field ebdb-field-passport)
+ _style
+ (_record ebdb-record))
+ (with-slots (country number) field
+ (format "(%s) %s" country number)))
+
(cl-defmethod ebdb-fmt-field ((_fmt ebdb-formatter-ebdb)
(field ebdb-field-mail)
_style
diff --git a/ebdb.el b/ebdb.el
index 8b452d7..587a4f0 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2378,8 +2378,15 @@ record uuids.")
(cl-call-next-method class slots obj)))
(cl-defmethod ebdb-string ((field ebdb-field-passport))
- (with-slots (country number) field
- (format "(%s) %s" country number)))
+ (with-slots (country number issue-date expiration-date) field
+ (format "(%s) %s\nIssued: %s\nExpires: %s"
+ country number
+ (format-time-string
+ "%F" (apply #'encode-time 0 0 0
+ (calendar-gregorian-from-absolute issue-date)))
+ (format-time-string
+ "%F" (apply #'encode-time 0 0 0
+ (calendar-gregorian-from-absolute expiration-date))))))
;;; The cache class
- [elpa] externals/ebdb updated (91d73f8 -> b0029d3), Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb 6267cf7 3/6: Refine passport field string output,
Eric Abrahamsen <=
- [elpa] externals/ebdb ebfec5d 1/6: Add support for Wanderlust MUA, Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb 5b044ca 2/6: More complete support for Wanderlust MUA, Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb 067ab28 5/6: More autoloads and defvars for ebdb-wl, Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb 894643d 4/6: Don't use either variant of when-let and if-let, Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb b0029d3 6/6: Bump to version 0.3.4, Eric Abrahamsen, 2017/10/08