Date Filter

I have a DataGrid2 with a Date Filter on header. Currently, it displays the date with the month and year, but I want it to only show the year, such as 2021, 2022, 2023. How can I achieve this?  
2 answers

Dear Asad Aslam,


I had the same requirement; you can solve this with some widgets in Marketplace.


Let me tell you how you can solve this problem with the default filters.

  • With Date filter you can hide day and month with CSS.
  • You can use number filter by storing year as number in new attribute.


Hope my answer helps, reach me out for any queries. 


Hi Asad Aslam,


Dou you want to change the date picker UI or Just Date Showing in Date box in frontend?


If you want to change in date selection i.e., DatePicker then you have to look for some marketplace widgets like Mendix Marketplace - Month and Year Picker


Or if you want to just show the year in the date input widget box, then you can use Date Format section and can select the format in which you have to view in frontend.