Calendar icon indicating copy to clipboard operation
Calendar copied to clipboard

Age incorrect for private contacts from Fossify Contacts who are born before 1970

Open genodeftest opened this issue 1 year ago • 3 comments

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 SettingsShow private contacts to Fossify Dialer, Fossify SMS Messenger and Fossify Calendar enabled.

  1. In Fossify Contacts, create a contact in Phone Storage (not visible by other apps)
  2. Fill in a birthday before 1970-01-01
  3. Save the contact
  4. Open Fossify Calendar. It will immediately import the added contact
  5. 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: Fossify Contacts

Calendar date (2024-04-14): Fossify Calendar

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.

genodeftest avatar Mar 30 '24 15:03 genodeftest

Hello, me and @Yaassiihh will work on this

TristanDonze avatar Mar 31 '24 15:03 TristanDonze

@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 avatar Apr 24 '24 23:04 nofishonfriday

@nofishonfriday yes but we still haven't started it, we will probably next week, sorry for the inconvenience

TristanDonze avatar Apr 25 '24 10:04 TristanDonze