mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00: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:
parent
746252fe39
commit
325d5f7ba9
6 changed files with 16 additions and 40 deletions
|
|
@ -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()});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue