Use user's timezone for default entry date on log page

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
derekcandClaude Opus 5.5 committed 2026-10-30 21:47:29 -07:00
1 parent 850f0fca8f
commit 68e66c5cd9
1 file changed
+7 -1
+7 -1
View File
@@ -91,7 +91,13 @@
<script src="/js/auth.js"></script> <script src="/js/auth.js"></script>
<script> <script>
function today() { function today() {
return new Date().toISOString().split('T')[0]; // en-CA formats as YYYY-MM-DD; use the user's saved timezone, falling back to the browser's
const tz = Auth.getUser()?.timezone;
try {
return new Intl.DateTimeFormat('en-CA', { timeZone: tz || undefined }).format(new Date());
} catch (_) {
return new Intl.DateTimeFormat('en-CA').format(new Date());
}
} }
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {