Add support for setting user timezone

This commit is contained in:
Peter Stockings
2024-12-28 01:11:11 +11:00
parent 32f810a8b3
commit 2caddf52fe
9 changed files with 147 additions and 270 deletions

View File

@@ -107,7 +107,7 @@
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 8v4l3 3m9-3a9 9 0 1 1-18 0 9 9 0 0 1 18 0z" />
</svg>
<span title="{{ reading.timestamp.strftime('%d %b %Y, %I:%M %p') }}">
<span title="{{ reading.local_timestamp.strftime('%d %b %Y, %I:%M %p') }}">
{{ reading.relative_timestamp }}
</span>
</div>
@@ -163,7 +163,7 @@
<p class="text-xs text-gray-600 mt-1">{{ reading.heart_rate }} bpm</p>
<!-- Timestamp -->
<div class="text-xs text-gray-500 mt-1">
{{ reading.timestamp.strftime('%I:%M %p') }}
{{ reading.local_timestamp.strftime('%I:%M %p') }}
</div>
</a>
{% endfor %}
@@ -222,7 +222,7 @@
<p class="text-xs text-gray-600 mt-1">{{ reading.heart_rate }} bpm</p>
<!-- Timestamp -->
<div class="text-xs text-gray-500 mt-1">
{{ reading.timestamp.strftime('%I:%M %p') }}
{{ reading.local_timestamp.strftime('%I:%M %p') }}
</div>
</a>
{% endfor %}

View File

@@ -57,6 +57,12 @@
focus:ring-blue-500") }}
</div>
<div class="mb-4">
{{ form.timezone.label(class="block text-sm font-medium text-gray-700") }}
{{ form.timezone(class="w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500")
}}
</div>
<div class="mb-4 flex items-center">
{{ form.dark_mode }}
{{ form.dark_mode.label(class="ml-2 text-sm font-medium text-gray-700") }}