nimiew / pe

0 stars 0 forks source link

DateTime Error #1

Open nimiew opened 4 years ago

nimiew commented 4 years ago

image.png Instead of error for 31/11/2019, app changes it to 30/11/2019 instead.

image.png Similarly, for 30/02/2019, app changes it to 28/02/2019

nus-pe-bot commented 4 years ago

Team's Response

Ok this is intended due to a strange quirk for Java LocalDateTime.parse(String, DateTimeFormatter). It would throw an exception for a String such as "33/12/2019". However, if the day is still a legal integer(0-31) for a month, it wouldn't outright throw an exception. So if the String to parse is for example "31/02/2019", an impossible date, it accepts the String but "round down" that day to the nearest actual day that the month can actually have, which is 28 (or 29 if it's a leap year). Thus this LocalDateTime feature is a way to circumvent typo mistakes by the user if they meant the last legal day of the month (eg. "29/02/2019" inputted when they meant "28/02/2019" because it's not a leap year).

Low-severity issue because a task with an impossible date is not added in and normal operations can still be done.

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: A reasonable approach will be to bring up the error, asking the user to verify his input. In addition, the response "a task with an impossible date is not added in" clearly does not make sense. How is "29/02/2019" a valid input? What if he typos, and he actually means "29/03/2019" instead. In conclusion, you have to verify with user no matter what - cannot simply change date for them. Arguably, this is a very huge error for the user, as he may miss some tasks due to typo but is unaware.


:question: Issue severity

Team chose [severity.Low]. Originally [severity.Medium].

Reason for disagreement: [replace this with your reason]