0

I want to display events within a given month, the event has a start and end date, I cannot find a way to accommodate for events that span more than 2 month.
I tried the following, discarding the syntax (it's episerver find client API)

currentEvents = SearchClient.Instance.Search<EventPage>()
               .Filter(page => page.FromDate.Exists() & page.ToDate.Exists())
               .Filter(page => page.FromDate.InRange(start, end, true, true) | page.ToDate.InRange(start, end, true, true))

let's assume some event has starting date of '20/11/2014' and an ending date of '10/2/2015', by logic it falls in month 1, but using the above logic it will not show.
any idea?

Tawfik Khalifeh
  • 939
  • 6
  • 21

1 Answers1

0

If I have understood what you are asking try this

currentEvents = SearchClient.Instance.Search<EventPage>()
               .Filter(page => page.FromDate.Exists() & page.ToDate.Exists())
               .Filter(page => page.FromDate >= start && page.EndDate <= end)
faby
  • 7,394
  • 3
  • 27
  • 44