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

[PE-D][Tester A] Entering of invalid dates does not throw error #172

Closed
soc-pe-bot opened this issue Nov 3, 2023 · 2 comments · Fixed by #213
Closed

[PE-D][Tester A] Entering of invalid dates does not throw error #172

soc-pe-bot opened this issue Nov 3, 2023 · 2 comments · Fixed by #213
Assignees
Labels
bug Something isn't working priority.Medium Do when have time.
Milestone

Comments

@soc-pe-bot
Copy link

Typing an invalid date (31 Feb) causes an appointment of 28 Feb to be added.

image.png


Labels: type.FunctionalityBug severity.Low
original: RoeReRe/ped#3

@kohkaijie
Copy link

kohkaijie commented Nov 7, 2023

This issue is caused due to our method isValidAppointmentTime using the default formatter which adjusts the date to a valid one when an invalid date. It seems that as long as the month and date are within the constraints (i.e 1-12 for month and 1-31 for date) an invalid input such as add-appt pic/S1112228G dic/S2223338G time/2000-02-31 13:00 will cause the parser to automatically adjust the date to be the last day of the specified month.

If we are unable to fix the parser, the best fix for this problem would be to state in the user guide that if the date exceeds the number of days for that specified month but is still within 31, the app will automatically input the last day of that month, and justify it as an intended feature :)

@kohkaijie kohkaijie added the priority.Medium Do when have time. label Nov 7, 2023
@cmHuang777 cmHuang777 added the bug Something isn't working label Nov 8, 2023
@cmHuang777 cmHuang777 added this to the v1.4 milestone Nov 8, 2023
@cmHuang777 cmHuang777 self-assigned this Nov 9, 2023
@cmHuang777
Copy link

As discussed, we will just add .withResolverStyle(ResolverStyle.STRICT) to our DateTimeFormatter to fix this bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority.Medium Do when have time.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants