branch: externals/ebdb
commit c9f8f3368ce50257ea3db9e788a1da4f1e530bac
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Be more when careful migrating timestamps
* ebdb-migrate.el (ebdb-migrate-vector-to-class): The BBDB timestamps
may be missing hour/minute/second values, in which case replace
those nils with 0s.
---
ebdb-migrate.el | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/ebdb-migrate.el b/ebdb-migrate.el
index 2c326ab..471a0c6 100644
--- a/ebdb-migrate.el
+++ b/ebdb-migrate.el
@@ -516,12 +516,22 @@ holding valid contacts in a previous BBDB format."
(setq ts (make-instance 'ebdb-field-timestamp
:timestamp
(apply #'encode-time
- (parse-time-string val)))))
+ (mapcar
+ (lambda (el)
+ (if (null el)
+ 0
+ el))
+ (parse-time-string val))))))
((eq lab 'creation-date)
(setq c-date (make-instance 'ebdb-field-creation-date
:timestamp
(apply #'encode-time
- (parse-time-string val)))))
+ (mapcar
+ (lambda (el)
+ (if (null el)
+ 0
+ el))
+ (parse-time-string val))))))
((eq lab 'mail-alias)
(push (make-instance 'ebdb-field-mail-alias
:alias val