cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sarangan Rajamanickam (JIRA)" <>
Subject [jira] [Commented] (CB-11052) contacts: returns birthday as null when year is not specified
Date Sat, 09 Apr 2016 00:06:25 GMT


Sarangan Rajamanickam commented on CB-11052:

I have completed my analysis. Let me summarize the points:

# While saving a contact with a birthday, the birthday must be a date object instantiate with
one of the date constructors such as new Date(1976, 8, 8)/new Date("1987/8/8")/etc. 
# Please refer the following links:
## []
## []
## []
# As you can see in the links, the year format is not an optional one. It is mandatory. For
example try the following in chrome browser console new Date("20/Feb") will make this date
"20/Feb/2001". Whereas safari browser console and firefox browser console will just throw
the error as "Invalid Date". In essence, do NOT create a date without year. 
# Now, Looking into cordova on android, I get the behavior as in chrome - i.e. the default
year is made 2001.
## HTML Source: []
## JS Source: []
Does this mean there is some issue that it returns null for you and 2001 for me? No. It is
just an invalid input (without the year) and so the output might vary based on various versions.

The conclusion is that a JS Date without year is not a valid scenario and not supported and
the recommendation is not to use it. 

As there are no remaining work items on this ticket, I am resolving this.

> contacts: returns birthday as null when year is not specified
> -------------------------------------------------------------
>                 Key: CB-11052
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Contacts
>            Reporter: Mohit Gupta
>            Assignee: Sarangan Rajamanickam
>              Labels: Android, triaged
> I have created a contact with birth date without adding the year.(20/Feb)
> When I retrieve the contact from the system,the birth date it returns is null. 
> I have tested it on Android with different dates, still the same behavior.
> Versions:
> Android: 6.0.1
> Cordova: 6.1.1
> Platform: 5.1.1
> Cordova-Plugin-Contacts: 2.0.1

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message