Skip to content

Adding a meal with a date that doesn't exist in February will automatically add the meal with the last possible day of February #5

@philip1304

Description

@philip1304

When adding a meal with the add mealEntry command, if you state a date in February that does not exist in that year (e.g., 29th on a non-leap year or the 30th or 31st of February), it will add the meal entry but add it to the last day of February in that year.

Screenshot 2024-11-15 at 4.49.35 PM.png

Steps to reproduce:

  1. Add a meal entry with the add mealEntry command, using either the 29th, 30th, or 31st of February. E.g., add mealEntry Carbonara /c500 /t2023-02-29
  2. The program will add the meal entry as Carbonara with a calorie count of 500, eaten on the date 2023-02-28.

The program will only do this for February, and on non-leap years where there are only 28 days, as well as the 30th and 31st days that do not exist in February. It will instead add the meal entry to the final day of the February in that year. If it is a leap year, meal entries logged for the 30th and 31st will be recorded as being eaten on the 29th, and if it is a non-leap year, it will record the meal as eaten on the 28th.

Screenshot 2024-11-15 at 4.52.32 PM.png

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions