I'm trying to add a compare condition for the case where a date is GreaterThanOrEqualTo a certain value. I need to define criteria to return objects with a date type inclusive to the cut-off date.
PropertyCriteria dateCriteriaMin = new PropertyCriteria();
dateCriteriaMin.Condition = EPiServer.Filters.CompareCondition.GreaterThanOrEqualTo;
dateCriteriaMin.Name = "StartDate";
dateCriteriaMin.Type = PropertyDataType.Date;
dateCriteriaMin.Value = model.StartDate.ToString();
dateCriteriaMin.Required = true;
Obviously there is no CompareCondition defined for >=, so I was also looking for a "not less than" operator as a substitute.
Can someone tell me how this is done in EPi?
Hey, someone else with the exact same problem:
Uh oh, no responses since 2007. That never bodes well...
Any other fans of LTE/GTE out there? How about NOT? Anyone?
Hi Ian,As you say there is no CompareCondition for the 'GreaterThanOrEqual' case, but would it not be possible in your case to work around the problem by subtracting one unit (day/second/whatever) and use GreaterThan instead? I know it's not 100%, but perhaps it's good enough in your case?