mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:42:38 +00:00
Activity date-range calendar has no cell for the day daylight saving starts at local midnight #1128
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1128
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
TZ=Africa/Cairoin 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).19 20 21 22 23 23 25. There is no 24.The unfiltered list had all eight payments. With only the range changed, in the same wallet:
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. WithTZ=America/Santiago, September 2026 shows 5 twice and no 6. WithTZ=Europe/BerlinandTZ=UTCevery 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 asnew 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
qt6at2bd5a61e8304andeed1f426fcb6, macOS arm64 / Qt 6.9.0, offscreen only, with the zone given throughTZfor 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).