History: set fromDate hour to 0:00 and toDate hour to 23:59

This commit is contained in:
rating89us 2021-07-19 09:20:26 +02:00 committed by GitHub
parent b6682330a6
commit d3a689d857
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1439,9 +1439,8 @@ Rectangle {
// applying filters
root.txData = JSON.parse(JSON.stringify(root.txModelData)); // deepcopy
const timezoneOffset = new Date().getTimezoneOffset() * 60;
var fromDate = Math.floor(fromDatePicker.currentDate.getTime() / 86400000) * 86400 + timezoneOffset;
var toDate = (Math.floor(toDatePicker.currentDate.getTime() / 86400000) + 1) * 86400 + timezoneOffset;
var fromDate = fromDatePicker.currentDate.setHours(0, 0, 0, 0);
var toDate = toDatePicker.currentDate.setHours(23, 59, 59, 999);
var txs = [];
for (var i = 0; i < root.txData.length; i++){
@ -1449,7 +1448,7 @@ Rectangle {
var matched = "";
// daterange filtering
if(item.timestamp < fromDate || item.timestamp > toDate){
if(item.timestamp * 1000 < fromDate || item.timestamp * 1000 > toDate){
continue;
}