saschpe / BirthdayCalendar

Get a birthday calendar for all your social networks right inside your calendar app (such as Google Calendar). Supports all apps which sync contacts with your Android device, that includes many social network and messaging apps. Enable reminder alarms and decide which contacts you want to see. You'll get notifications for all of them.
https://sites.google.com/view/birthday-calendar/home
GNU General Public License v3.0
72 stars 20 forks source link

Events without year use 1970 #31

Open crazygolem opened 3 years ago

crazygolem commented 3 years ago

When a contact has a an event set with a date without the year, BirthdayCalendar displays the year in messages as "1970", and computes ages (for birthday events) from 1970.

The issue is in CalendarSyncService: https://github.com/saschpe/BirthdayCalendar/blob/0d42b6278b626d75fdd95d4e369f263a815ab8c6/mobile/src/main/java/saschpe/birthdays/service/CalendarSyncService.java#L439-L445 After setting the year of the Calendar to 1700, the Date is not updated (SufficientlySecure/birthday-calendar had the same issue: #66).

Looking through the code I could not find any other reference to the year 1700, so probably the code https://github.com/saschpe/BirthdayCalendar/blob/0d42b6278b626d75fdd95d4e369f263a815ab8c6/mobile/src/main/java/saschpe/birthdays/service/CalendarSyncService.java#L147-L176 would also need to be adapted to check for that, and the title and description strings adapted accordingly.

I have not been able to setup a test environment yet with the AVD to check it out (I'm not usually an Android dev and I get stuck on stupid things), but I can look into it further if you would like a PR.

PanderMusubi commented 3 years ago

Address books allow birthdays without a year, so that should be supported here too.