Approved
Last Updated: 08 Oct 2019 07:01 by ADMIN
Mat
Created on: 01 Oct 2019 12:20
Category: Filter
Type: Feature Request
1
Formatting expressionPreview in Filter

Hi Team,

When a date filter is applied in the new Filter widget, the preview looks like: "Date Is After 'Tue Jan 01 2019 00:00:00 GMT+0000 (Greenwich Mean Time)'" -- I'd like to be able to customize the displayed date format, something like adding "format:"{0:dd/MM/yyyy}" to the 'fields' object.

Thanks

1 comment
ADMIN
Alex Hajigeorgieva
Posted on: 08 Oct 2019 06:36

Hi, Mat,

Thank you so much for this feature request. I can definitely see the value in it and I have proposed to my Team Lead that we include it in our pipeline. It was accepted and we will be implementing it. Meanwhile, you could format the filter dates value programmatically. I wrote this function that seems to do the job and here is a runnable Dojo that shows it in action:

https://dojo.telerik.com/@bubblemaster/ISiqIMax/2

 function formatDates(e) {
        var filterValues = $(".k-filter-preview-value");
        $.each(filterValues, function(i, item){
          var valueString = $(item).text().replace("'", "");
          var date = kendo.parseDate(valueString)
          if(date){
            var formattedDate = kendo.toString(date, "dd/MM/yyyy");
            $(item).text(formattedDate);
          }
        })
      }

Let me know in case you have further questions or ideas regarding this future functionality.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.