girzel / ebdb

An EIEIO port of BBDB, Emacs' contact-management package
67 stars 12 forks source link

Error when exporting contacts with birthdays to vcard #85

Closed DerBeutlin closed 4 years ago

DerBeutlin commented 4 years ago

Hi first of all great module! It's clear that much thought went into it.

However I have a problem when exporting contacts with birthdays. In that case (https://github.com/girzel/ebdb/blob/15fdedb14666ac2b5013b0350a72eb0e08efe201/ebdb-vcard.el#L397) raises
Wrong type argument: number-or-marker-p (11 29 1990) If the birthday field is removed everything works fine.

I'm using Emacs 27.0.90

girzel commented 4 years ago

Ooh, the vcard stuff isn't really done yet, sorry about that. I recently wrote a separate package-independent library for parsing and writing vcards (in ELPA now), and the next step is to use that to flesh out EBDB's vcard handling: writing, importing, and eventually a database that uses vcard files for storage.

girzel commented 4 years ago

Let me see if I can fix this immediate bug, but then I might close this in favor of #2, which I see has been open for three and a half years :(

girzel commented 4 years ago

Would you eval this method and see if it fixes the problem?

(cl-defmethod ebdb-fmt-field ((_f ebdb-formatter-vcard)
                  (ann ebdb-field-anniversary)
                  _style
                  _record)
  (pcase-let ((`(,month ,day ,year)
           (slot-value ann 'date)))
    (if year
    (format "%d%02d%02d" year month day)
      (format "%02d%02d" month day))))
DerBeutlin commented 4 years ago

Yes this seems to fix the problem! Thanks!