Self hosted FLOSS fitness/workout, nutrition and weight tracker
Document the per-user timezone
Roland Geider3f30a7c8f0c8
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex aeba69c54..eda5c3da8 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -80,6 +80,11 @@ pip install wger-api-client* <https://github.com/wger-project/api-client>+### Your own timezone+Streaks, calendar days and trophies are now calculated in your own timezone.+The apps report it automatically, until they have, or for accounts that only+ever use scripts, the server's timezone is used like before.+### Others* Reworked internal structure for workout sessions. This now allows sessions to spanmidnight, and to log more than one session per day, e.g. morning cardio and evening@@ -155,6 +160,12 @@ like openScale do not need any changes.`date`, so a single day is selected with `?datetime_start__date=2026-01-15`and a range with `?datetime_start__gte=...`.+### Userprofile+* New field `time_zone` on `/api/v2/userprofile/`: the user's IANA timezone+ name, e.g. `Pacific/Auckland`. Clients should write it whenever it differs+ from what the profile holds. Empty means no client has reported one yet, and+ the instance timezone is used as the fallback.+### Removed* Removed the temporary `/api/v2/issue-refresh-token` endpoint. It existed only@@ -163,6 +174,10 @@ like openScale do not need any changes.## Upgrade steps+* Make sure `TIME_ZONE` is set correctly **before** upgrading, and treat it as+ fixed afterwards. The migration converts the old session dates using this+ zone, and it stays the fallback for users whose apps have not reported their+ own one yet. Changing it later shifts those users' past training days.* Pull new changes from the docker repo. There were changes to the sync rules dueto the new measurements. It is recommended to stop the powersync service whilethe db migrations are running:diff --git a/wger/core/migrations/0028_userprofile_timezone.py b/wger/core/migrations/0028_userprofile_timezone.pyindex 334a2169a..fcbef79c8 100644--- a/wger/core/migrations/0028_userprofile_timezone.py+++ b/wger/core/migrations/0028_userprofile_timezone.py@@ -17,6 +17,8 @@ class Migration(migrations.Migration):field=models.CharField(blank=True,default='',+ help_text='IANA timezone name, e.g. "Europe/Berlin". Empty means no '+ 'client has reported one and the instance timezone is used.',max_length=50,validators=[validate_timezone],verbose_name='Timezone',diff --git a/wger/core/models/profile.py b/wger/core/models/profile.pyindex feaaacbd7..88eb65289 100644--- a/wger/core/models/profile.py+++ b/wger/core/models/profile.py@@ -347,6 +347,8 @@ class UserProfile(models.Model):blank=True,default='',validators=[validate_timezone],+ help_text='IANA timezone name, e.g. "Europe/Berlin". Empty means no '+ 'client has reported one and the instance timezone is used.',)"""IANA timezone name (e.g. "Europe/Berlin") used to compute what calendar day