Skip to content

Add computed age field to pets#87

Open
meysholdt wants to merge 1 commit intomainfrom
feature/pet-computed-age
Open

Add computed age field to pets#87
meysholdt wants to merge 1 commit intomainfrom
feature/pet-computed-age

Conversation

@meysholdt
Copy link
Copy Markdown
Contributor

Derive pet age from birthDate and display it on the owner details page next to the birth date.

Changes

  • Pet.java — Add getAge() method that computes age in years via Period.between(birthDate, LocalDate.now()). Returns null if birthDate is unset. Not persisted.
  • ownerDetails.html — Show (N years old) inline after the birth date, with singular/plural handling and text-muted styling.

Derive pet age from birthDate using Period.between and display it
on the owner details page next to the birth date.

Co-authored-by: Ona <no-reply@ona.com>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant