fix: day grouping compares against the local date, not the UTC one
renderFiles() derived "today" from new Date().toISOString(), which is UTC, and compared it to f.date — the recording start in local time, parsed server-side out of the filename. In any non-UTC timezone the two disagree for part of every day, and the current day's group (the one always wanted open) renders collapsed: 00:00-02:00 local in UTC+2, most of the evening in UTC-5. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -772,7 +772,11 @@ function renderFiles(files) {
|
||||
document.getElementById('empty').style.display = visible ? 'none' : '';
|
||||
|
||||
const days = groupByDay(files);
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
// Local date, not toISOString() — f.date is the recording start in local
|
||||
// time, so a UTC "today" leaves the current day collapsed for part of every
|
||||
// day in any non-UTC timezone (00:00–02:00 in UTC+2, all evening in UTC−5).
|
||||
const now = new Date();
|
||||
const today = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;
|
||||
|
||||
days.forEach((dayFiles, day) => {
|
||||
const dayId = 'day-' + day.replace(/-/g, '');
|
||||
|
||||
Reference in New Issue
Block a user