Github user dblotsky commented on a diff in the pull request:

    
https://github.com/apache/cordova-plugin-contacts/pull/95#discussion_r46360939
  
    --- Diff: src/android/ContactAccessorSdk5.java ---
    @@ -451,7 +452,13 @@ else if 
(mimetype.equals(CommonDataKinds.Website.CONTENT_ITEM_TYPE)
                         else if 
(mimetype.equals(CommonDataKinds.Event.CONTENT_ITEM_TYPE)) {
                             if (isRequired("birthday", populate) &&
                                     CommonDataKinds.Event.TYPE_BIRTHDAY == 
c.getInt(colEventType)) {
    -                            contact.put("birthday", 
c.getString(colBirthday));
    +
    +                            try {
    +                                long timestamp = 
Date.valueOf(c.getString(colBirthday)).getTime();
    +                                contact.put("birthday", timestamp);
    +                            } catch (IllegalArgumentException e) {
    +                                Log.d(LOG_TAG, "Failed to get birthday for 
contact: " + e.getMessage());
    +                            }
    --- End diff --
    
    This code is duplicated below. Please place it in a function. Also, if 
there is an `IllegalArgumentException`, a birthday won't be set at all; is this 
what we define as expected behaviour for this plugin's API?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to