mirror of
https://github.com/coalaura/whiskr.git
synced 2025-12-02 20:22:52 +00:00
incorrect time calculation for search
This commit is contained in:
4
exa.go
4
exa.go
@@ -134,7 +134,7 @@ func ExaRunSearch(ctx context.Context, args SearchWebArguments) (*ExaResults, er
|
||||
case "month":
|
||||
data["startPublishedDate"] = daysAgo(30)
|
||||
case "year":
|
||||
data["startPublishedDate"] = daysAgo(356)
|
||||
data["startPublishedDate"] = daysAgo(365)
|
||||
}
|
||||
|
||||
req, err := NewExaRequest(ctx, "/search", data)
|
||||
@@ -168,5 +168,5 @@ func ExaRunContents(ctx context.Context, args FetchContentsArguments) (*ExaResul
|
||||
}
|
||||
|
||||
func daysAgo(days int) string {
|
||||
return time.Now().Add(time.Duration(days) * 24 * time.Hour).Format(time.DateOnly)
|
||||
return time.Now().Add(-time.Duration(days) * 24 * time.Hour).Format(time.DateOnly)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user