nus-cs2113-AY2324S2 / pe-dev-response

0 stars 0 forks source link

leap year dates #678

Open nus-se-script opened 2 months ago

nus-se-script commented 2 months ago

image.png


[original: nus-cs2113-AY2324S2/pe-interim#776] [original labels: type.FunctionalityBug severity.Medium]

nur-haziq commented 2 months ago

Team's Response

Thank you for testing out leap years.

However, in the image you have attached, the date you have keyed in, 29-02-2026, is not a leap day. I am confused by this, given that the title of your bug report seems to be leap year dates, which is why I assumed that you would test dates of leap days.

Additionally, our application does accept leap days, as can be seen below.


image.png


I hope you understand my decision to tag this as IssueUnclear.


PS. If you are wondering why the date is changed to 28-02-2026 in your scenario, my groupmate has described it as follows:

This is an interesting catch. I was able to reproduce this bug using different dates, such as 31-02-2025 (which is resolved to 28-02-2025), or >31-06-2024 (which is resolved to 30-06-2024).

I have done a bit of research on this, and this appears to be an odd quirk of the java.time.format.DateTimeFormatter class.

This was an oversight on my part, as I wasn't aware of the different types of year formatters that can be used.

Duplicate status (if any):

--