shunyao643 / pe

0 stars 0 forks source link

Repeat Monthly Task repeats on the wrong date #3

Open shunyao643 opened 2 years ago

shunyao643 commented 2 years ago

Input: add taskMONTHLY31 /do 31/1/2023 /start 15:00 /end 15:02 /repeat MONTHLY

It was expected that the task repeated on the 31st of every month. It was the case for 31 Jan, but from Feb onwards, it repeated on 28th instead.

image.png

soc-se-bot commented 2 years ago

Team's Response

The dates for the next occurrence is incremented from the previous task thus causing the next tasks to be on the 28th. If the dates are incremented w.r.t the date specified in the command, the end date and the incremented date will be the same and the loop will stop. Hence, #639 and #641 are related and are caused by the same defect.

The 'Original' Bug

[The team marked this bug as a duplicate of the following bug]

Inconsistent number of repeats for Monthly tasks

Input:

add taskMONTHLYA /do 31/1/2023 /start 15:00 /end 15:02 /repeat MONTHLY

add taskMONTHLYB /do 1/1/2023 /start 12:00 /end 12:02 /repeat MONTHLY

show all

(Truncated) Output:

____________________________________________________________
Here are the tasks in your list:
------------------------------------------------------------------------------------------------------------
|  Task Number  |  Mark Status  |  Task Description    |  To do/attend on               |  To complete by  |
|      1        |               |  taskMONTHLYB        |  Sun, 01/01/2023 12:00 - 12:02 |                  |
|      2        |               |  taskMONTHLYA        |  Tue, 31/01/2023 15:00 - 15:02 |                  |
|      3        |               |  taskMONTHLYB        |  Wed, 01/02/2023 12:00 - 12:02 |                  |
|      4        |               |  taskMONTHLYA        |  Tue, 28/02/2023 15:00 - 15:02 |                  |
|      5        |               |  taskMONTHLYB        |  Wed, 01/03/2023 12:00 - 12:02 |                  |
|      6        |               |  taskMONTHLYA        |  Tue, 28/03/2023 15:00 - 15:02 |                  |
|      7        |               |  taskMONTHLYB        |  Sat, 01/04/2023 12:00 - 12:02 |                  |
|      8        |               |  taskMONTHLYA        |  Fri, 28/04/2023 15:00 - 15:02 |                  |
|      9        |               |  taskMONTHLYB        |  Mon, 01/05/2023 12:00 - 12:02 |                  |
|      10       |               |  taskMONTHLYA        |  Sun, 28/05/2023 15:00 - 15:02 |                  |
|      11       |               |  taskMONTHLYB        |  Thu, 01/06/2023 12:00 - 12:02 |                  |
|      12       |               |  taskMONTHLYA        |  Wed, 28/06/2023 15:00 - 15:02 |                  |
|      13       |               |  taskMONTHLYB        |  Sat, 01/07/2023 12:00 - 12:02 |                  |
|      14       |               |  taskMONTHLYA        |  Fri, 28/07/2023 15:00 - 15:02 |                  |
|      15       |               |  taskMONTHLYB        |  Tue, 01/08/2023 12:00 - 12:02 |                  |
|      16       |               |  taskMONTHLYA        |  Mon, 28/08/2023 15:00 - 15:02 |                  |
|      17       |               |  taskMONTHLYB        |  Fri, 01/09/2023 12:00 - 12:02 |                  |
|      18       |               |  taskMONTHLYA        |  Thu, 28/09/2023 15:00 - 15:02 |                  |
|      19       |               |  taskMONTHLYB        |  Sun, 01/10/2023 12:00 - 12:02 |                  |
|      20       |               |  taskMONTHLYA        |  Sat, 28/10/2023 15:00 - 15:02 |                  |
|      21       |               |  taskMONTHLYB        |  Wed, 01/11/2023 12:00 - 12:02 |                  |
|      22       |               |  taskMONTHLYA        |  Tue, 28/11/2023 15:00 - 15:02 |                  |
|      23       |               |  taskMONTHLYB        |  Fri, 01/12/2023 12:00 - 12:02 |                  |
|      24       |               |  taskMONTHLYA        |  Thu, 28/12/2023 15:00 - 15:02 |                  |
|      25       |               |  taskMONTHLYA        |  Sun, 28/01/2024 15:00 - 15:02 |                  |
------------------------------------------------------------------------------------------------------------
You have a total of 25 task(s)!

According to the user guide, I will be expecting a year's worth of tasks. I assumed this to mean 12 iterations of the task. However, with the two sets of inputs, I obtained a differing number of tasks. taskMONTHLYA repeated for 13 times while taskMONTHLYB repeated for 12 times.

image.png


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

Their Response to the 'Original' Bug

[This is the team's response to the above 'original' bug]

The dates are incremented from the previous task which is why every task inherits the date of the 2nd task (28th). This causes the loop to run one extra time (since 28th jan < 31st jan) thus creating the 13th task.

Items for the Tester to Verify

:question: Issue duplicate status

Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)

Reason for disagreement: [replace this with your explanation]