mirror of
https://github.com/immich-app/immich.git
synced 2025-12-17 09:13:17 +03:00
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:
@@ -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()});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user