[Wallet] Transaction View: LastMonth calculation fixed#7327
[Wallet] Transaction View: LastMonth calculation fixed#7327jonasschnelli merged 1 commit intobitcoin:masterfrom
Conversation
|
Can you please rewrite this a bit? E.g. calculate Does January 1st belong to the previous month? |
|
I'm not sure if it would be better readable, we would need an integer for the year (prevMonthYear) and an integer for the month (prevMonthFirstDay) and calculate both depending on current.month(), so the If/else statement wouldn't get shorter. Technically January 1st does not belong to the previous month, but since the old range-calculation in this method computed the last month from 1st to 1st I didn't want to change that logic. Maybe someone somewhere relies on this... |
|
ping @jonasschnelli |
|
Please don't implement your own logic here. Qt already has all of this built in. fa51939 is enough. |
|
Whenever I think I know (most of) Qt someone shows me that I don't...thanks @MarcoFalke 👍 I've changed and tested it, works fine. |
|
Offtopic: @crowning- I saw you implemented wallet maintenance (rescan, etc) over the GUI. I think this is considered useful for bitcoin core as well (ping @jonasschnelli ?) Have you ever thought about porting it to bitcoin core? |
src/qt/transactionview.cpp
Outdated
There was a problem hiding this comment.
nit: please realign with the other "case" structures (re-add the \t).
There was a problem hiding this comment.
Also squash, having two commits does not make sense here.
|
Tested ACK. nit: code alignment. |
|
Alignment fixed, sorry. |
|
Can you squash the commits into one? |
|
Squashed! |
|
Tested ACK 30cdace |
30cdace [Wallet] Transaction View: LastMonth calculation fixed (crowning-)
Github-Pull: bitcoin#7327 Rebased-From: 30cdace
In January (in this example, January 2016), last month isn't from 2016-0-1 to 2016-1-1, it's from 2015-12-1 to 2016-1-1.
Edit: this means in each January the "Last Month" filter simply does not work.