fix(mobile): person birthday viewing/editing (#20731)

* fix: edit birthday dialog

* chore: convert age to "x years old" format

* fix: lint

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Brandon Wees 2025-08-06 17:13:56 -05:00 committed by GitHub
parent 746252fe39
commit 325d5f7ba9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 16 additions and 40 deletions

View file

@ -9,11 +9,11 @@ String formatAge(DateTime birthDate, DateTime referenceDate) {
int ageInMonths = _calculateAgeInMonths(birthDate, referenceDate);
if (ageInMonths <= 11) {
return "exif_bottom_sheet_person_age_months".t(args: {'months': ageInMonths.toString()});
return "person_age_months".t(args: {'months': ageInMonths.toString()});
} else if (ageInMonths > 12 && ageInMonths <= 23) {
return "exif_bottom_sheet_person_age_year_months".t(args: {'months': (ageInMonths - 12).toString()});
return "person_age_year_months".t(args: {'months': (ageInMonths - 12).toString()});
} else {
return "exif_bottom_sheet_person_age_years".t(args: {'years': ageInYears.toString()});
return "person_age_years".t(args: {'years': ageInYears.toString()});
}
}