stepanzubkov / shellodoro

powerful Pomodoro in terminal
The Unlicense
9 stars 1 forks source link

New stats format #9

Closed stepanzubkov closed 2 years ago

stepanzubkov commented 2 years ago

Stats don't work properly Stats now saved like this:

{
    "days": [
        {
            "name": "Monday",
            "pomodoros": 0
        },
        ...
        {
            "name": "Sunday",
            "pomodoros": 0
        }
    ]
}

Let's say I decide to try out the app on Thursday, September 8th. I did 5 laps and looked at the stats. Everything is fine. But a month later, on Tuesday, I decided to try it again. I did 2 laps and looked at the stats again. Statistics show that this week I used the application on Tuesday and Thursday. But I didn’t use it this week Thursday (it didn’t even come)!. This is a big problem. Statistics are not reset.

Link to date, not day of week We can store statistics in a different way, for example

{ "08.09.2022": 5, "25.10.2022": 2}

This will help link statistics not to the day of the week, but to the date. Also, I can now view statistics for a certain period of time. It will be possible to set up automatic deletion of statistics.

Any alternatives? Other ways to store stats

[
    {"date": "01.01.1", "pomodoros": 4}
    ...
]
{
    "pomodoros": {
         "08.08.1492": 4
         ...
     }
}