Need a special offer?Find out if your project fits.
+

Filter Dialog Date Picker Has Incorrect Date Format

Answered
John W asked on April 2, 2019

I just upgraded to version 2.7.2.  The new filtering dialog box displays dates in the European format, and not the US format.  How can I change this?  The attached JPG shows it is displayed as "02/04/2019", and I would like it to be "04/02/2019".
Thanks.

Attachments:
Date Picker Format.JPG

5 answers

Public
Vera Didenko Vera Didenko Flexmonster April 3, 2019

Hello, John,

Thank you for writing to us.

The desired date format displayed in the filters can be set using the dateFormat parameter in the filter field of the options object:

options: {
   filter: {
               dateFormat: "MM/dd/yyyy"
   }
}

Here is a JSFiddle example.
 

Please let us know if this works for you and if you have further questions.

Best Regards,
Vera 

Public
Denis January 14, 2021

Hello Vera,
 
I have the similar issue. In my case I need to support format string like this 'yyyy-MM-dd' for example. Also I tried to put it into your JSFiddle example, but it doesn't work.
 
Is it possible to use this format string?
 
Thanks for your help.
 
Kind regards,
Denis

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster January 14, 2021

Hello, Denis,
 
Thank you for reaching out to us.
 
Our team would like to explain that filter.dateFormat property of the options object has only two possible values: "dd/MM/yyyy" and "MM/dd/yyyy", as described in our documentation.
 
To use another date pattern, we suggest utilizing the datePattern property of the options object. We have modified the JSFiddle provided earlier to demonstrate this functionality. Please note that this property also affects the pattern displayed on the grid.
 
Please let us know if it helps.
Feel free to contact us in case other questions arise.
 
Kind regards,
Illia

Public
Denis January 14, 2021

Hello Illia,
 
Thanks for your answer.
 
As I see, date pattern on the filter dialog on your example does not match with required one. Pattern applied only for the grid but not for the filter (I've attached a screenshot)
 
Kind regards,
Denis

Attachments:
FilterDialog.PNG

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster January 15, 2021

Hello, Denis,
 
Thank you for your feedback and for providing the screenshot.
 
It helped to get a better understanding of your requirement.
 
You are right about the fact that the options.datePattern property does not affect the date filter. It allows formatting dates on the grid and in the members filter instead.
 
In its turn, the formatting in the date filter can only be adjusted using the filter.dateFormat property mentioned earlier. However, it only supports two possible values: "dd/MM/yyyy" or "MM/dd/yyyy". Currently, other formats are not supported in the date filter.
 
Please contact us in case other questions arise.
 
Kind regards,
Illia

Please login or Register to Submit Answer