SOLVED

Display a RefinableDate as Slider Refiner

Brass Contributor

I'm facing an issue in in two seperate Office 365 Tenants, bot show the same behaviour.

I have created a SharePoint column (Date & Time), this column has a crawled property which has been added to a OOTB RefinableDate01 Managed Peroperty.

 

When displaying a Filter with Bar Graph on my SharePoint page, I'm seeing my values shown as below. In another environment i'm seeing comma''s instead of dots.

 

 

Of course I want to display these values as "Last Year", "One Year Ago" etc. Who has an idea what to do?

I have tried to follow the steps in Elio Struyf's article, but since I am working with a OOTB RefinableSting, none of these steps are exactly what I am looking for.

Slider RefinableDate.png

8 Replies
Did you already get a answer?

Not yet Paul

I have noticed this on at least 4 different tenancies which previously were exhibiting the correct behaviour for a Date/Time refiner based on a RefinableDatexx managed property.

So most likely Microsoft has made some changes that caused this behaviour...

Now, I can either raise a service request, or find a workaround/fix. If anyone has an idea how to work around this issue, please share!

 

 

best response confirmed by Rémy Bosman (Brass Contributor)
Solution

Something has changed in the search.clientcontrols.js script. Before the RefinableDate managed properties were mapped as DateTime (which is now changed to ECMADATE). Now with the script update, they are mapped as EcmaDateRefinersInvariant which does not contain the date range labels.

 

snip_20170103223938.png

 

As an example, I added the same date ranges also for the EcmaDateRefinersInvariant type:

 

snip_20170103224249.png

 

Which renders this result:

 

snip_20170103224439.png

 

 

The *bug* in the code is that the SearchType for the ECMADATE type is overwritten, first when they set the EcmaDateRefinersSingle and after that by EcmaDateRefinersInvariant. So when you use a RefinableDate or auto-created managed property (one with an OWSDATE suffix), it will always return as an EcmaDateRefinersInvariant type. Which does not contain date labels.

 

So IMO there are two solutions, adding the labels also for the EcmaDateRefinersSingle and EcmaDateRefinersInvariant types. Or changing the order of the registration, so that EcmaDate is registered last:

 

snip_20170103230901.png

 

As a workaround, I have added a temporary template with fixes the issue. You can find it in the GitHub repository: Filter_SliderBarGraph_Date_O365.html

Many Thanks Elio! I will pass this throught to Microsoft.
For now your workaround works perfectly.

FYI. I just received a message from Microsoft Support.

 

"The fix got accepted by the product group and is currently scheduled to be deployed in around mid of April 2017"

 

Great news, thanks for the update!
1 best response

Accepted Solutions
best response confirmed by Rémy Bosman (Brass Contributor)
Solution

Something has changed in the search.clientcontrols.js script. Before the RefinableDate managed properties were mapped as DateTime (which is now changed to ECMADATE). Now with the script update, they are mapped as EcmaDateRefinersInvariant which does not contain the date range labels.

 

snip_20170103223938.png

 

As an example, I added the same date ranges also for the EcmaDateRefinersInvariant type:

 

snip_20170103224249.png

 

Which renders this result:

 

snip_20170103224439.png

 

 

The *bug* in the code is that the SearchType for the ECMADATE type is overwritten, first when they set the EcmaDateRefinersSingle and after that by EcmaDateRefinersInvariant. So when you use a RefinableDate or auto-created managed property (one with an OWSDATE suffix), it will always return as an EcmaDateRefinersInvariant type. Which does not contain date labels.

 

So IMO there are two solutions, adding the labels also for the EcmaDateRefinersSingle and EcmaDateRefinersInvariant types. Or changing the order of the registration, so that EcmaDate is registered last:

 

snip_20170103230901.png

 

As a workaround, I have added a temporary template with fixes the issue. You can find it in the GitHub repository: Filter_SliderBarGraph_Date_O365.html

View solution in original post