aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrating89us <45968869+rating89us@users.noreply.github.com>2021-06-06 22:02:41 +0200
committerrating89us <rating89us@rating89us.com>2021-06-09 09:38:12 +0200
commit1f8aa0dff05d06cdd64687206c13e7b05fbe3467 (patch)
tree1bdec1c2f1fba6beccddcb94f70fc4c5a03da0d2
parent2946127ed791ef8dd6dc430b681a14cd5bd2d71e (diff)
downloadmonzero-gui-1f8aa0dff05d06cdd64687206c13e7b05fbe3467.tar.gz
monzero-gui-1f8aa0dff05d06cdd64687206c13e7b05fbe3467.tar.xz
monzero-gui-1f8aa0dff05d06cdd64687206c13e7b05fbe3467.zip
History: change default dates of "Date from" and "Date to" DatePicker components
-rw-r--r--pages/History.qml11
1 files changed, 9 insertions, 2 deletions
diff --git a/pages/History.qml b/pages/History.qml
index 03d30c5e..8af94a19 100644
--- a/pages/History.qml
+++ b/pages/History.qml
@@ -1384,7 +1384,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
@@ -1762,7 +1762,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();