Age incorrect for private contacts from Fossify Contacts who are born before 1970
Checklist
- [X] I can reproduce the bug with the latest version given here.
- [X] I made sure that there are no existing issues - open or closed - to which I could contribute my information.
- [X] I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
- [X] I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
- [X] I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
- [X] This issue contains only one bug.
- [X] I have read and understood the contribution guidelines.
Affected app version
1.0.3
Affected Android/Custom ROM version
Android 13, patchlevel 2024-01-05 (FP4.TP29.C.0101.20240121)
Affected device model
Fairphone 4
How did you install the app?
F-Droid / IzzyOnDroid
Steps to reproduce the bug
Precondition: In Fossify Contacts, have Settings → Show private contacts to Fossify Dialer, Fossify SMS Messenger and Fossify Calendar enabled.
- In Fossify Contacts, create a contact in Phone Storage (not visible by other apps)
- Fill in a birthday before 1970-01-01
- Save the contact
- Open Fossify Calendar. It will immediately import the added contact
- In Fossify Calendar, navigate to the contact's birthday anniversary (e.g. 2024-04-14 if the contact was born in 1962-04-14)
Expected behavior
Show the real age of the contact at their birthday anniversary. For a contact born on 1962-04-14, that would be 62 years on 2024-04-14.
Actual behavior
For every person born before 1970, the age is calculated as if they were born in 1970 (on the same day). I.e., the person born on 1962-04-14 would be shown age 54 on 2024-04-14, as if it were born on 1970-04-14.
Screenshots/Screen recordings
Contact:
Calendar date (2024-04-14):
Additional information
This issue had been reported against Simple Calendar before (SimpleMobileTools/Simple-Calendar/#1812), where @Aga-C gave a hint to the probable cause for this issue:
The problem is only with private contacts from Simple Contacts […]. It seems to be related to this fragment of code in MainActivity:
if (date.year < 70) { date.year = 70 }
Fossify Calendar inherited this code in app/src/main/kotlin/org/fossify/calendar/activities/MainActivity.kt.
Hello, me and @Yaassiihh will work on this
@Daemanon Are you still planning to work on it? To me it looks like simply removing the three lines in the opening post will fix it, but maybe I'm wrong?
@nofishonfriday yes but we still haven't started it, we will probably next week, sorry for the inconvenience