cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblotsky <...@git.apache.org>
Subject [GitHub] cordova-plugin-contacts pull request: CB-8115 Save contact birthda...
Date Wed, 02 Dec 2015 00:17:02 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message