Skip to content
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

Conversation

starchypotatocode
Copy link

No description provided.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ Complexity Δ
...in/java/hallpointer/address/model/member/Room.java 100.00% <ø> (ø) 7.00 <0.00> (ø)
...ava/hallpointer/address/model/member/Telegram.java 100.00% <ø> (ø) 7.00 <0.00> (ø)
...hallpointer/address/model/session/SessionDate.java 100.00% <100.00%> (ø) 11.00 <4.00> (+3.00)
...c/main/java/hallpointer/address/model/tag/Tag.java 71.42% <ø> (ø) 5.00 <0.00> (ø)

Copy link

@QinHaichen12 QinHaichen12 left a 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

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

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

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

@QinHaichen12 QinHaichen12 merged commit 901f01d into AY2425S1-CS2103T-W14-3:master Nov 8, 2024
4 checks passed
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.

2 participants