nus-cs2103-AY2324S2 / pe-dev-response

0 stars 0 forks source link

Error message for date input not specific enough #3228

Open nus-pe-bot opened 2 months ago

nus-pe-bot commented 2 months ago

image.png I tried adding in date of 01/20/2000 as it is possible for users to exchange the numbers instead of 01/02/2000 but it did not tell me that my date is out of the date range instead that i did not follow the format incorrect.


[original: nus-cs2103-AY2324S2/pe-interim#4074] [original labels: severity.Low type.FeatureFlaw]

erv-teo commented 2 months ago

Team's Response

The date does not follow the format provided, as the month (>12) is not within an acceptable range for the specified date format. In this case, the input "01/20/2000" is of the format "MM/dd/yyyy" which is an invalid format. Since we only accept "dd/MM/yyyy", the error message correctly states that this is an invalid format, and prompts the user to key in a reasonable month (instead of 20) to fit the "dd/MM/yyyy" format.

Going by your example, this is a user error. For example, if this were to happen to the "dd" field instead, there will be no way for our system to validate the input between "20" and "02", as they are both valid days and this is instead a user error. For date validation (whether the date itself is a valid date), it is under our planned enhancements.

For date being out of range (in our case, out of range means beyond the current date), an error message will be thrown to inform the user accordingly: image.png

Duplicate status (if any):

--