chore(@desktop/wallet): Use correct period of weeks filtering (#11362)
This commit is contained in:
parent
ad489a224c
commit
c842876791
|
@ -1,6 +1,7 @@
|
||||||
import QtQuick 2.13
|
import QtQuick 2.13
|
||||||
|
|
||||||
import SortFilterProxyModel 0.2
|
import SortFilterProxyModel 0.2
|
||||||
|
import StatusQ.Core 0.1
|
||||||
|
|
||||||
import utils 1.0
|
import utils 1.0
|
||||||
|
|
||||||
|
@ -46,19 +47,19 @@ QtObject {
|
||||||
toTimestamp = dt1.valueOf()
|
toTimestamp = dt1.valueOf()
|
||||||
break
|
break
|
||||||
case Constants.TransactionTimePeriod.ThisWeek:
|
case Constants.TransactionTimePeriod.ThisWeek:
|
||||||
let dt2 = new Date()
|
let dt2 = LocaleUtils.getFirstDayOfTheCurrentWeek()
|
||||||
let firstDayOfCurrentWeek = dt2.getDate() - dt2.getDay()
|
|
||||||
dt2.setDate(firstDayOfCurrentWeek)
|
|
||||||
dt2.setHours(0, 0, 0, 0)
|
dt2.setHours(0, 0, 0, 0)
|
||||||
fromTimestamp = dt2.valueOf() // This week
|
fromTimestamp = dt2.valueOf() // First day of this week
|
||||||
toTimestamp = new Date().valueOf()
|
toTimestamp = new Date().valueOf() // Today
|
||||||
break
|
break
|
||||||
case Constants.TransactionTimePeriod.LastWeek:
|
case Constants.TransactionTimePeriod.LastWeek:
|
||||||
let dt3 = new Date()
|
let dt3 = LocaleUtils.getFirstDayOfTheCurrentWeek()
|
||||||
dt3.setDate(dt3.getDate() - 7)
|
dt3.setDate(dt3.getDate() - 7)
|
||||||
dt3.setHours(0, 0, 0, 0)
|
dt3.setHours(0, 0, 0, 0)
|
||||||
fromTimestamp = dt3.valueOf() // Last week
|
fromTimestamp = dt3.valueOf() // First day of last week
|
||||||
toTimestamp = new Date().valueOf()
|
dt3.setDate(dt3.getDate() + 6)
|
||||||
|
dt3.setHours(23, 59, 59, 0)
|
||||||
|
toTimestamp = dt3.valueOf() // Last day of last week
|
||||||
break
|
break
|
||||||
case Constants.TransactionTimePeriod.ThisMonth:
|
case Constants.TransactionTimePeriod.ThisMonth:
|
||||||
let dt4 = new Date()
|
let dt4 = new Date()
|
||||||
|
|
Loading…
Reference in New Issue