-
Notifications
You must be signed in to change notification settings - Fork 2
fix: fix the date formatting for date strings for DoB #1640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes date formatting for Date of Birth (DoB) values by simplifying the formatCompactDate function and standardizing date formats across the codebase. The changes ensure consistent handling of date strings in ISO format (YYYY-MM-DD) rather than compact format (YYYYMMDD).
- Simplified
formatCompactDatefunction to use native Date constructor instead of manual string parsing - Updated mock data to use ISO date format (YYYY-MM-DD) for consistency
- Updated test cases to reflect the new expected input format
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| utils.ts | Simplified formatCompactDate function and minor quote consistency fix |
| utils.test.ts | Updated test input format from compact to ISO date format |
| mockExceptions.json | Converted all DateOfBirth values from YYYYMMDD to YYYY-MM-DD format |
Comments suppressed due to low confidence (1)
application/CohortManager/src/Web/app/lib/utils.test.ts:37
- The test coverage for
formatCompactDateis insufficient. Consider adding tests for edge cases such as invalid date strings, empty strings, and malformed date formats to ensure the function handles them gracefully.
describe("formatCompactDate", () => {
it("should format the date as 26 February 1993", () => {
const input = "1993-02-26";
const expectedOutput = "26 February 1993";
expect(formatCompactDate(input)).toBe(expectedOutput);
});
});
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bc8ccf5 to
332f693
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|



Description
fix: fix the date formatting for date strings for DoB
Context
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.