@@ -289,12 +289,13 @@ func (a *Action) GetIssueContent() string {
289289
290290// GetFeedsOptions options for retrieving feeds
291291type GetFeedsOptions struct {
292- RequestedUser * User // the user we want activity for
293- RequestedTeam * Team // the team we want activity for
294- Actor * User // the user viewing the activity
295- IncludePrivate bool // include private actions
296- OnlyPerformedBy bool // only actions performed by requested user
297- IncludeDeleted bool // include deleted actions
292+ RequestedUser * User // the user we want activity for
293+ RequestedTeam * Team // the team we want activity for
294+ Actor * User // the user viewing the activity
295+ IncludePrivate bool // include private actions
296+ OnlyPerformedBy bool // only actions performed by requested user
297+ IncludeDeleted bool // include deleted actions
298+ Date string // the day we want activity for: YYYY-MM-DD
298299}
299300
300301// GetFeeds returns actions according to the provided options
@@ -380,5 +381,17 @@ func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) {
380381 cond = cond .And (builder.Eq {"is_deleted" : false })
381382 }
382383
384+ if opts .Date != "" {
385+ dateLow , err := time .Parse ("2006-01-02" , opts .Date )
386+ if err != nil {
387+ log .Warn ("Unable to parse %s, filter not applied: %v" , opts .Date , err )
388+ } else {
389+ dateHigh := dateLow .Add (86399000000000 ) // 23h59m59s
390+
391+ cond = cond .And (builder.Gte {"created_unix" : dateLow .Unix ()})
392+ cond = cond .And (builder.Lte {"created_unix" : dateHigh .Unix ()})
393+ }
394+ }
395+
383396 return cond , nil
384397}
0 commit comments