0

I try to get birthdate of a contact in a windows store apps. I get always the same wrong date (year 4, month 5 and day 5). Someone try it?

var contactPicker = new Windows.ApplicationModel.Contacts.ContactPicker();
var selectedContact = await contactPicker.PickContactAsync();
var birthDate = selectedContact.ImportantDates.FirstOrDefault(@d => @d.Kind == ContactDateKind.Anniversary || @d.Kind == ContactDateKind.Birthday);
if (birthDate != null)
    // always 4-5-5
    Debug.WriteLine("{0}-{1}-{2}", birthDate.Year, birthDate.Month, birthDate.Day); 

Any help would be appreciated!

Have a good day.

droopy
  • 1
  • 1

1 Answers1

0

For me this here is working:

var birthday = selectedContact.ImportantDates.FirstOrDefault(d => d.Kind == ContactDateKind.Birthday);
timtos
  • 2,225
  • 2
  • 27
  • 39