branch: externals/ebdb
commit ce5d9ee855acbec7c326d09ad243ce399fb0f3a7
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>

    Fix vCard formatting for anniversaries
    
    * ebdb-vcard.el (ebdb-fmt-field): There will be more cases to handle
      than just this, but this ought to do it for now.
---
 ebdb-vcard.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ebdb-vcard.el b/ebdb-vcard.el
index 1019a2e..29e37ab 100644
--- a/ebdb-vcard.el
+++ b/ebdb-vcard.el
@@ -342,5 +342,14 @@ method is just responsible for formatting the record name."
     (concat label-string (format ";CALSCALE=%s"
                                 (slot-value ann 'calendar)))))
 
+(cl-defmethod ebdb-fmt-field ((_f ebdb-formatter-vcard)
+                             (ann ebdb-field-anniversary)
+                             _style
+                             _record)
+  (pcase-let ((`(,month ,day ,year)
+              (calendar-gregorian-from-absolute
+               (slot-value ann 'date))))
+    (format "%d%02d%02d" year month day)))
+
 (provide 'ebdb-vcard)
 ;;; ebdb-vcard.el ends here

Reply via email to