aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-06-10 11:02:36 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-06-10 11:02:36 -0500
commit0bd4d731d2725e36c5272e5d9e669a5a428982cb (patch)
tree2414de28b386747949393743285f1e1b6fe144eb
parente3a17a66ff5c20b3c39d40265bee3dfd7f7a46a9 (diff)
parent1f8aa0dff05d06cdd64687206c13e7b05fbe3467 (diff)
downloadmonzero-gui-0bd4d731d2725e36c5272e5d9e669a5a428982cb.tar.gz
monzero-gui-0bd4d731d2725e36c5272e5d9e669a5a428982cb.tar.xz
monzero-gui-0bd4d731d2725e36c5272e5d9e669a5a428982cb.zip
Merge pull request #3535
1f8aa0d History: change default dates of 'Date from' and 'Date to' DatePicker components (rating89us)
-rw-r--r--pages/History.qml11
1 files changed, 9 insertions, 2 deletions
diff --git a/pages/History.qml b/pages/History.qml
index e28fe8eb..c0776421 100644
--- a/pages/History.qml
+++ b/pages/History.qml
@@ -1399,7 +1399,7 @@ Rectangle {
}
if (typeof root.model !== 'undefined' && root.model != null) {
- toDatePicker.currentDate = root.model.transactionHistory.lastDateTime
+ toDatePicker.currentDate = new Date(); //today
}
// extract from model, create JS array of txs
@@ -1777,7 +1777,14 @@ Rectangle {
root.model = appWindow.currentWallet.historyModel;
root.model.sortRole = TransactionHistoryModel.TransactionBlockHeightRole
root.model.sort(0, Qt.DescendingOrder);
- fromDatePicker.currentDate = model.transactionHistory.firstDateTime
+ var count = root.model.rowCount()
+ if (count > 0) {
+ //date of the first transaction
+ fromDatePicker.currentDate = root.model.data(root.model.index((count - 1), 0), TransactionHistoryModel.TransactionDateRole);
+ } else {
+ //date of monero birth (2014-04-18)
+ fromDatePicker.currentDate = model.transactionHistory.firstDateTime
+ }
}
root.reset();