nus-cs2103-AY2122S1 / pe-dev-response

0 stars 0 forks source link

Not enough validation check for date #5840

Open nus-se-bot opened 2 years ago

nus-se-bot commented 2 years ago

Steps to reproduce: add a reservation with a invalid date such as 2022-02-30 13:00, using the command add -rs/ -dt/2022-02-30 13:00 -rm/2 people -id/00002

Expected: An error message saying "The date is invalid"

Actual: No error message is shown and the reservation with the input date is added successfully

image.png


[original: nus-cs2103-AY2122S1/pe-interim#5873] [original labels: severity.Low type.FunctionalityBug]

zzybluebell commented 2 years ago

Team's Response

Thank you for your effort and time. However, we believe that this is not a bug.

We made use of DateTimeFormatter (https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html) API and LocalDateTime (https://docs.oracle.com/javase/8/docs/api/java/time/LocalDateTime.html) API provided by Java for our DateTime field.

According to the doc by Oracle, Day from 1 to 31 is accepted for February.

Our team did notice this issue during our implementation. However, for example, if we decide to manually adjust the number of days in February for each and every year in the future, it would be too tedious and unrealistic, especially for a v1.4 release.

Hence, due to the limitation of DateTimeFormatter and LocalDateTime APIs, our team decided to not address this issue since it will not affect any usage of ezFoodie, i.e. a reservation instance of 02-30 will be displayed in GUI, which will not affect any other features as it is only for display purpose.

Duplicate status (if any):

--