MVC Partial View - trouble filtering out expired events
I have a view pulling in a list of events that have been specified (through the MNTP) to be on that page.
I'd like to not pull in events that have expired...I'm sure it's a syntax issue but I can't figure out the best way to do this. I have it done on another view but it doesn't seem to work the same way. Any ideas?
Thanks
----------------------------------
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ string monthYear = String.Empty; DateTime today = DateTime.Now; var eventContainerId = 1192; var categoryId = Model.Content.Id.ToString(); var events = Umbraco.TypedContent(eventContainerId).Children.Where(x => x.GetPropertyValue<string>("addtopages").Split(',').Contains(categoryId) );
MVC Partial View - trouble filtering out expired events
I have a view pulling in a list of events that have been specified (through the MNTP) to be on that page.
I'd like to not pull in events that have expired...I'm sure it's a syntax issue but I can't figure out the best way to do this. I have it done on another view but it doesn't seem to work the same way. Any ideas?
Thanks
----------------------------------
Please disregard I've tried to delete this topic but that doesn't seem t work. I found a solution probably not the cleanest but the syntax works
DateTime today = DateTime.Now;
var date2 = child.GetPropertyValue<DateTime>("startdate");
if (date2 >= today)
{
<li class="daticon"><a href="@child.Url">@child.Name</a><br/>@fullEventDate<br/>@eventStart -@eventEnd </li>
}
is working on a reply...