Commit Graph

7 Commits

Author SHA1 Message Date
Lukáš Kucharczyk 25deac6ea9
add more types 2024-08-08 21:19:43 +02:00
Lukáš Kucharczyk c44d8bf427 Improve time-related stuff
continuous-integration/drone/push Build is passing Details
Add created_at to all models
Add modified_at to Session
Get rid of custom now() function
Make sure aware datetime is used everywhere
2023-11-15 19:14:09 +01:00
Lukáš Kucharczyk 3b37f2c3f0 Fix edge case in format_duration
continuous-integration/drone/push Build is passing Details
Fixes #65

```python
def test_specific_precise_if_unncessary(self):
        delta = timedelta(hours=2, minutes=40)
        result = format_duration(delta, "%02.0H:%02.0m")
        self.assertEqual(result, "02:40")
```
This test fails by returning "03:40" instead. The problem is in the way `format_duration` handles fractional hours.
To fix it, we need to switch between using hours and fractional hours
depending on if minutes are present in the formatted string.
2023-11-10 20:07:41 +01:00
Lukáš Kucharczyk a6cd7a3430 Do not format as float if no precision specified
continuous-integration/drone/push Build is passing Details
2023-10-13 16:58:12 +02:00
Lukáš Kucharczyk 0e2113eefd Display durations in a consistent manner
Fixes #61
2023-10-13 16:32:12 +02:00
Lukáš Kucharczyk 11b9c602de Improve game overview
- add counts for each section
- add average hours per session
2023-10-09 00:00:45 +02:00
Lukáš Kucharczyk 56e5dfaa03 Rename project, part 2 (#42)
continuous-integration/drone/push Build is failing Details
Reviewed-on: #42
2023-01-20 13:37:46 +00:00