You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
The getYearsMonthsDaysFromDOB function in the OpenELIS codebase currently doesn’t handle date input validation well. It needs improvement to:
1. Ensure that only numeric values are accepted in the expected date format (dd/mm/yyyy or mm/dd/yyyy).
2. Provide better user feedback when the input is empty or invalid.
3. Improve error handling when the input format doesn’t match the required structure.
Current Behavior:
• The function accepts a date in the format dd/mm/yyyy or mm/dd/yyyy but doesn’t restrict input to only numeric characters.
• If the input is in an incorrect format (e.g., "abc/xyz/1234" or an empty string), it logs warnings but doesn’t effectively handle the invalid input.
• There’s minimal feedback to the user regarding invalid input.
Expected Behavior:
• The function should only accept numeric values for the day, month, and year parts of the date.
• It should check the input for the correct format and reject invalid or empty inputs.
• If the format is valid, the function should calculate the difference in years, months, and days between the current date and the provided date.
Steps to Reproduce:
1. Call getYearsMonthsDaysFromDOB with invalid date inputs, such as:
• "abc/xyz/1234"
• ""
2. Observe that while warnings are logged, the function does not handle these inputs properly or provide actionable feedback.
Acceptance Criteria:
• The function should properly validate that the input date contains only numeric characters and follows the format dd/mm/yyyy or mm/dd/yyyy.
• Clear and informative warnings should be logged when the input format is invalid.
• The calculation of years, months, and days should work correctly when valid input is provided.
Priority: Medium
The text was updated successfully, but these errors were encountered:
Description:
The getYearsMonthsDaysFromDOB function in the OpenELIS codebase currently doesn’t handle date input validation well. It needs improvement to:
1. Ensure that only numeric values are accepted in the expected date format (dd/mm/yyyy or mm/dd/yyyy).
2. Provide better user feedback when the input is empty or invalid.
3. Improve error handling when the input format doesn’t match the required structure.
Current Behavior:
• The function accepts a date in the format dd/mm/yyyy or mm/dd/yyyy but doesn’t restrict input to only numeric characters.
• If the input is in an incorrect format (e.g., "abc/xyz/1234" or an empty string), it logs warnings but doesn’t effectively handle the invalid input.
• There’s minimal feedback to the user regarding invalid input.
Expected Behavior:
• The function should only accept numeric values for the day, month, and year parts of the date.
• It should check the input for the correct format and reject invalid or empty inputs.
• If the format is valid, the function should calculate the difference in years, months, and days between the current date and the provided date.
Steps to Reproduce:
1. Call getYearsMonthsDaysFromDOB with invalid date inputs, such as:
• "abc/xyz/1234"
• ""
2. Observe that while warnings are logged, the function does not handle these inputs properly or provide actionable feedback.
Acceptance Criteria:
• The function should properly validate that the input date contains only numeric characters and follows the format dd/mm/yyyy or mm/dd/yyyy.
• Clear and informative warnings should be logged when the input format is invalid.
• The calculation of years, months, and days should work correctly when valid input is provided.
Priority: Medium
The text was updated successfully, but these errors were encountered: