Activity date-range calendar has no cell for the day daylight saving starts at local midnight #1128

Open
opened 2026-11-13 15:11:44 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-13 15:11:44 +00:00 (Migrated from github.com)

In a time zone where the clocks go forward at 00:00, the Custom range calendar does not draw that day. The day before is drawn twice, and the second copy selects the day before, so a range cannot start or end on the change day.

To reproduce:

  1. Start the regtest app with TZ=Africa/Cairo in its environment (Cairo's clocks went from 00:00 to 01:00 on Friday, April 24, 2026). Use a wallet with 1, 2, 3 and 2 payments on April 22, 23, 24 and 25, 2026, local time (mock time set before each payment and its block).
  2. Open Activity → Date → Custom range and step back to April 2026. The fourth week reads 19 20 21 22 23 23 25. There is no 24.
  3. Click the second 23 twice. From and To both read 4/23/26. Click Apply and export the list to CSV.

The unfiltered list had all eight payments. With only the range changed, in the same wallet:

Range wanted (April 2026) Cells clicked Range applied Expected payments Activity rows CSV data rows
24 only second 23, second 23 23 to 23 3 2 (both from the 23rd) 2
24 through 25 second 23, 25 23 to 25 5 7 7
22 through 24 22, second 23 22 to 23 6 3 3
23 through 25 first 23, 25 23 to 25 7 7 7
1 through 30 1, 30 1 to 30 8 8 8

A change day that is the last of its month is not drawn at all. With TZ=Asia/Beirut, March 2024 ends at 30: the 1st to the last cell listed 1 of that month's 4 payments, and the three from March 31 appeared only in a range running into April. With TZ=America/Santiago, September 2026 shows 5 twice and no 6. With TZ=Europe/Berlin and TZ=UTC every day was drawn once and every range returned the expected rows.

From and To show the dates really applied, the list and the CSV date each payment on its correct local day, and a range from the day before to the day after includes the change day. No amount or total is wrong.

The calendar takes the month length from new Date(year, month + 1, 0) and builds each cell as new Date(year, month, day), which is local midnight:

github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/controls/ActivityCalendar.qml (L140-L142)

For a midnight that does not exist, Qt's JavaScript engine returns 23:00 of the previous day (node returns 01:00 of the same day), so the cell's number and the date it selects are the previous day's. Arrow-key movement uses the same construction (L181). The filter already handles such a day through startOfDay() (activityfilterproxymodel.cpp#L512-L521), but the calendar cannot hand it that date. Cells built at local noon (new Date(year, month, day, 12)), or from plain day numbers, would avoid the missing midnight.

Zones that change at midnight today include Egypt, mainland Chile, Lebanon, the Azores and Cuba: one day a year, and the same day of earlier years (also Brazil up to 2018 and Iran up to 2022).

Reproduced on qt6 at 2bd5a61e8304 and eed1f426fcb6, macOS arm64 / Qt 6.9.0, offscreen only, with the zone given through TZ for the app process only. Day cells were clicked through the test bridge, and the export got its filename through Activity's export function. No arrow keys were sent and nothing ran in a native window. Related: #1108 (the filter's upper bound when the next local date was skipped) and #910 (calendar keyboard access).

In a time zone where the clocks go forward at 00:00, the **Custom range** calendar does not draw that day. The day before is drawn twice, and the second copy selects the day before, so a range cannot start or end on the change day. To reproduce: 1. Start the regtest app with `TZ=Africa/Cairo` in its environment (Cairo's clocks went from 00:00 to 01:00 on Friday, April 24, 2026). Use a wallet with 1, 2, 3 and 2 payments on April 22, 23, 24 and 25, 2026, local time (mock time set before each payment and its block). 2. Open **Activity → Date → Custom range** and step back to April 2026. The fourth week reads `19 20 21 22 23 23 25`. There is no 24. 3. Click the second 23 twice. **From** and **To** both read 4/23/26. Click **Apply** and export the list to CSV. The unfiltered list had all eight payments. With only the range changed, in the same wallet: | Range wanted (April 2026) | Cells clicked | Range applied | Expected payments | Activity rows | CSV data rows | |---|---|---|---:|---:|---:| | 24 only | second 23, second 23 | 23 to 23 | 3 | 2 (both from the 23rd) | 2 | | 24 through 25 | second 23, 25 | 23 to 25 | 5 | 7 | 7 | | 22 through 24 | 22, second 23 | 22 to 23 | 6 | 3 | 3 | | 23 through 25 | first 23, 25 | 23 to 25 | 7 | 7 | 7 | | 1 through 30 | 1, 30 | 1 to 30 | 8 | 8 | 8 | A change day that is the last of its month is not drawn at all. With `TZ=Asia/Beirut`, March 2024 ends at 30: the 1st to the last cell listed 1 of that month's 4 payments, and the three from March 31 appeared only in a range running into April. With `TZ=America/Santiago`, September 2026 shows 5 twice and no 6. With `TZ=Europe/Berlin` and `TZ=UTC` every day was drawn once and every range returned the expected rows. From and To show the dates really applied, the list and the CSV date each payment on its correct local day, and a range from the day before to the day after includes the change day. No amount or total is wrong. The calendar takes the month length from `new Date(year, month + 1, 0)` and builds each cell as `new Date(year, month, day)`, which is local midnight: https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/controls/ActivityCalendar.qml#L140-L142 For a midnight that does not exist, Qt's JavaScript engine returns 23:00 of the previous day (node returns 01:00 of the same day), so the cell's number and the date it selects are the previous day's. Arrow-key movement uses the same construction ([L181](https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/controls/ActivityCalendar.qml#L181)). The filter already handles such a day through `startOfDay()` ([activityfilterproxymodel.cpp#L512-L521](https://github.com/bitcoin-core/gui-qml/blob/2bd5a61e8304d5143e32f1ce977a2de2aceb6413/qml/models/activityfilterproxymodel.cpp#L512-L521)), but the calendar cannot hand it that date. Cells built at local noon (`new Date(year, month, day, 12)`), or from plain day numbers, would avoid the missing midnight. Zones that change at midnight today include Egypt, mainland Chile, Lebanon, the Azores and Cuba: one day a year, and the same day of earlier years (also Brazil up to 2018 and Iran up to 2022). Reproduced on `qt6` at `2bd5a61e8304` and `eed1f426fcb6`, macOS arm64 / Qt 6.9.0, offscreen only, with the zone given through `TZ` for the app process only. Day cells were clicked through the test bridge, and the export got its filename through Activity's export function. No arrow keys were sent and nothing ran in a native window. Related: #1108 (the filter's upper bound when the next local date was skipped) and #910 (calendar keyboard access).
Sign in to join this conversation.
No description provided.