diff --git a/app.py b/app.py index b9f4948..10a9f88 100644 --- a/app.py +++ b/app.py @@ -10,6 +10,7 @@ import matplotlib.dates as mdates import os import sparklines from dateutil.parser import isoparse +import humanize app = Flask(__name__) @@ -378,6 +379,7 @@ def get_workouts_for_user(user_id): 'user_name': user.name, 'start_time': format_date_with_ordinal(start_time, '%#H:%M %B %dth %Y'), 'start_time_date': start_time, + 'start_time_ago': humanize.naturaltime(start_time), 'duration': format_duration(duration), 'duration_minutes': duration.total_seconds() / 60, 'average_rpm': int(average_rpm), diff --git a/requirements.txt b/requirements.txt index 65b13d6..28875d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,5 @@ python-dateutil==2.8.2 bidict==0.22.1 Flask-SQLAlchemy==3.0.3 matplotlib==3.5.2 -sparklines==0.4.2 \ No newline at end of file +sparklines==0.4.2 +humanize==4.8.0 \ No newline at end of file diff --git a/templates/partials/calendar.html b/templates/partials/calendar.html new file mode 100644 index 0000000..0c19abc --- /dev/null +++ b/templates/partials/calendar.html @@ -0,0 +1,265 @@ +
+
+ October + 2020 +
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Mo

+
+
+
+

Tu

+
+
+
+

We

+
+
+
+

Th

+
+
+
+

Fr

+
+
+
+

Sa

+
+
+
+

Su

+
+
+
+

29

+
+
+
+

30

+
+
+
+

31

+
+
+
+

1

+
+
+
+

2

+
+
+
+

3

+
+
+
+

4

+
+
+
+

5

+
+
+
+

6

+
+
+
+ 7 +
+
+
+
+ 8 +
+
+
+
+

9

+
+
+
+

10

+
+
+
+

11

+
+
+
+

12

+
+
+
+

13

+
+
+
+

14

+
+
+
+

15

+
+
+
+

16

+
+
+
+

17

+
+
+
+

18

+
+
+
+

19

+
+
+
+

20

+
+
+
+

21

+
+
+
+

22

+
+
+
+

23

+
+
+
+

24

+
+
+
+

25

+
+
+
+

26

+
+
+
+

27

+
+
+
+

28

+
+
+
+

29

+
+
+
+

30

+
+
+
+

1

+
+
+
+

2

+
+
+
+
\ No newline at end of file diff --git a/templates/users_and_workouts.html b/templates/users_and_workouts.html index e945152..c0e3fc8 100644 --- a/templates/users_and_workouts.html +++ b/templates/users_and_workouts.html @@ -25,6 +25,7 @@ }; + diff --git a/templates/workouts_list.html b/templates/workouts_list.html index 16ccc8a..239d8e6 100644 --- a/templates/workouts_list.html +++ b/templates/workouts_list.html @@ -63,61 +63,78 @@