Changes

HowTo:Implement Custom Filtering

1,466 bytes added, 25 July
/* Filtering a DateTime Property */ added notes on ToCompare method output
'''Open Range'''
For range comparison, we use the .CompareTo method. As documented here, this method outputs a -1/0/1 depending on the compared string's location in the range. Our expression can target one output for an 'exclusive' filter (in which the inputted date is not considered for the range), however, a more likely scenario is that the user wants the inputted date included in the filter. This is why the expression in the StringFormatConverter should be defined as either !=-1 or !=1; the instance is either not less than a minimum (where true would be an output of 0 or 1), or not greater than a maximum (true = -1 or 0), respectively.
'''Closed Range'''
For range comparison, we use the .CompareTo method. As documented here, this method outputs a -1/0/1 depending on the compared string's location in the range. Our expression can target one output for an 'exclusive' filter (in which the inputted date is not considered for the range), however, a more likely scenario is that the user wants the inputted date included in the filter. This is why the expression in the StringFormatConverter should be defined for start date as !=-1, and for end date as !=1; the instance should be not less than than the start date (where true would be an output of 0 or 1), and not greater than the end date (true = -1 or 0), respectively.
 
 
{{Attention|Note the .CompareTo method used in each half of the ranged filter expression! The start date comparison is !=-1, whereas the end date comparison !=1. }}
<br>
696
edits