nus-cs2103-AY2324S2 / pe-dev-response

0 stars 0 forks source link

When inputting invalid date error shows appointment already exist #2864

Open nus-se-script opened 3 months ago

nus-se-script commented 3 months ago

When adding an appointment on the 30th of February 2025, MediCLI says appointment already exists, when in fact it is an invalid date.

Example: addappt ad/2025-02-30 10:15 dn/S1234567B pn/S1234567A

It is expected to say invalid date.

image.png


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

officialchengyud commented 2 months ago

Team's Response

Thank you for spotting this. We believe this is a duplicate of issue #5190 as it stems from Java Datetime rounding down incorrect dates.

What this means is, inputting 2025-02-30 10:15 will actually be changed to 2025-02-28 10:15 by Java Datetime, and this is in conflict with the existing appointment index 3. Solving the validation issue in #5190 will automatically solve this issue too, thus it is a duplicate bug.

Duplicate status (if any):

Duplicate of #5190