Bug 389 - Incorrect user's age was returned
Summary: Incorrect user's age was returned
Status: RESOLVED FIXED
Alias: None
Product: online shop management system
Classification: Unclassified
Component: User (show other bugs)
Version: 1.0.0
Hardware: PC Windows
: High normal
Assignee: Silvia
URL:
Depends on:
Blocks:
 
Reported: 2020-11-05 23:20 HKT by Silvia
Modified: 2020-11-10 15:33 HKT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Silvia 2020-11-05 23:20:00 HKT
Today is 05/11/2020, the day of birth of the user is 25/12/2000. The correct age 19 maybe return but the system returns 20.
Comment 1 Silvia 2020-11-05 23:38:21 HKT
The user is not birthday yet but the system returns the age is greater than his own age. For example, today is 05/11/2020, the day of birth of the user is 25/12/2000. The correct age 19 should be returned by the system but the system returns 20.
Comment 2 Silvia 2020-11-10 15:26:32 HKT
Today is 05/11/2020, the day of birth of the user is 25/12/2000.
Step of the test:
1. Create a new user
2. Enter the data of the user
3. Calculate the age based on the entered birth of day of user
19 should be the expected output but 20 is observed
Comment 3 Silvia 2020-11-10 15:33:58 HKT
This issue is resolved by Calculating the age step by step. First, calculate the year. Then calculate the same month but the day is bigger than today's day, if it is true then the age will -1. After that, calculate the month only, if the birthday month is bigger than the current month, the age will -1.