-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve date parsing #167
Improve date parsing #167
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
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.
LGTM!
} | ||
// Fix month case issue | ||
month = month.substring(0, 1).toUpperCase() + month.substring(1).toLowerCase(); | ||
// Nothing can be done about year errors due to ambiguity |
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.
what does year error mean
assertFalse(SessionDate.isValidDate("30 Mar 024")); // invalid year | ||
assertFalse(SessionDate.isValidDate(" Mar 2024")); // missing day | ||
assertFalse(SessionDate.isValidDate("29 2024")); // missing month | ||
assertFalse(SessionDate.isValidDate("30 Mar ")); // missing year | ||
|
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.
should there be test cass for invalid dates such as 40 sep 2024
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.
nvm i saw the prev test
No description provided.