Skip to content

Commit

Permalink
include current day
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Sep 28, 2023
1 parent 9a653df commit 2c9e39c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (a *api) handleGetWeb3Index(c jape.Context) {

start := now.AddDate(-1, 0, 0)
start = start.AddDate(0, 0, -int(start.Weekday()+1))
end := now.AddDate(0, 0, int(7-now.Weekday()))
end := now.AddDate(0, 0, 1)

days, err := a.sp.Periods(start, end, stats.PeriodDaily)
if err != nil {
Expand All @@ -175,9 +175,6 @@ func (a *api) handleGetWeb3Index(c jape.Context) {

for i := len(days) - 1; i > 0; i-- {
current, prev := days[i], days[i-1]
if current.Timestamp.After(time.Now()) {
continue
}
resp.Days = append(resp.Days, Web3IndexDay{
Date: current.Timestamp.Unix(),
Revenue: current.Revenue.USD - prev.Revenue.USD,
Expand Down

0 comments on commit 2c9e39c

Please sign in to comment.