I tried the following code to set birthday for a contact in Gmail. It says cannot setDate of undefined.
What am i doing wrong?
var contacts = ContactsApp.getContactsByName('John Doe');
var birthday = contacts[0].getDates(ContactsApp.Field.BIRTHDAY)[0];
birthday.setDate(ContactsApp.Month.APRIL, 1, 1980);