AY2122S2-CS2103T-T11-3 / tp

CS2103T Project SoC InternApply
MIT License
0 stars 5 forks source link

[PE-D] edit /idt command bug #185

Closed nus-se-script closed 2 years ago

nus-se-script commented 2 years ago

Certain invalid date times are accepted by the command without producing an error message.

To reproduce: Run "edit 10 idt/31-02-2022 13:45" The application creates an interview with a modified date 28 Feb 2022 instead of producing an error.


Labels: severity.Low type.FeatureFlaw original: manu2002g/ped#9

lchokhoe commented 2 years ago

"Must fix" Bug. Would need to modify InterviewSlot#toLocalDateTime() method to reject "invalid dates".

Solution found: https://stackoverflow.com/questions/32823368/java-8-localdatetime-is-parsing-invalid-date

The argument passed into InterviewSlot#toLocalDateTime() include .withResolverStyle(ResolveStyle.STRICT).

Also, the pattern used can be changed to "dd-MM-uuuu HH:mm" instead. image

Reason for "u" instead of "y": https://stackoverflow.com/questions/41177442/uuuu-versus-yyyy-in-datetimeformatter-formatting-pattern-codes-in-java

laughingkid-sg commented 2 years ago

he command without producing an error message.

To reproduce: Run "edit 10 idt/31-02-2022 13:45" The application creates an interview with a modified date 28 Feb 2022 instead of producing an error.

This bug already flagged in #101