History: change default dates of "Date from" and "Date to" DatePicker components

This commit is contained in:
rating89us 2021-06-06 22:02:41 +02:00 committed by rating89us
parent 2946127ed7
commit 1f8aa0dff0

View file

@ -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,8 +1762,15 @@ Rectangle {
root.model = appWindow.currentWallet.historyModel;
root.model.sortRole = TransactionHistoryModel.TransactionBlockHeightRole
root.model.sort(0, Qt.DescendingOrder);
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();
root.refresh();