Created
January 26, 2015 15:11
-
-
Save estruyf/b7108e73d498e5154584 to your computer and use it in GitHub Desktop.
Trick the refiner into thinking it is a date and time MP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var propertyName = ctx.RefinementControl.propertyName; | |
| // Let the refiner think it is a datetime field, needed for custom managed properties | |
| ctx.RefinementControl.propertyName = trickDateProperty(propertyName); | |
| // Retrieving the labels | |
| ctx.BucketedFilterData = AjaxControlToolkit.SliderRefinementControl.GetDefaultBuckets(ctx); | |
| // Reset the property name | |
| ctx.RefinementControl.propertyName = propertyName; | |
| function trickDateProperty (prop) { | |
| // Check if the property does not contain the OWSDATE suffix | |
| if (prop.toUpperCase().indexOf('OWSDATE') === -1) { | |
| return prop + "OWSDATE"; | |
| } | |
| return prop; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment