nus-cs2113-AY2021S1 / pe-dev-response

0 stars 0 forks source link

Date formatting error #3061

Open nus-pe-bot opened 3 years ago

nus-pe-bot commented 3 years ago

Issue description Did not catch wrong date and even accepted it as another date

Steps to reproduce the issue

  1. type add class /n Math class /s 2020-10-38 1000 /e 2020-10-38 1001
  2. press enter

What’s the expected result? Exception handling stating date is not accepted

What’s the actual result?

image.png


[original: nus-cs2113-AY2021S1/pe-interim#3056]

durianpancakes commented 3 years ago

Team's Response

Hi! This is a result of using Java's Calendar and LocalDateTime API, where it accepts dates that appear to be invalid as it adds on leftover days to the next month. (i.e in this case, where you entered 2020-10-38, there are 7 leftover days that is then added to the month of November). This is something that we cannot change as a result of using these APIs. Thank you for bringing this issue up.

Duplicate status (if any):

--