System date in advanced filter

Hi,

Is it possible to use system date in advanced filter somehow? Small example of what I try to achieve:

Like 0

Like

4 comments

Dear Taras,



Could you please specify exactly what information you expect to receive from the system Data filter, we do not fully understand the needs of your request.



Best regards,

Pavlo.

I expect to see just current date there. The main goal is to make filter display 0 records whenever it is used on Sundays

Taras,

 

It won't be possible to add a condition like in your screenshot. Are we interested in a specific filter all in any filter in the section (for example disable displaying data in some section on Sunday)? If so we can restrict loading data to grid on Sundays using:

loadGridData: function() {
					var currentDate = new Date();
					var currentDayNumber = currentDate.getDay();
					var restrictDataLoading = currentDayNumber == 0;
					if (restrictDataLoading) {
						return;
					}
					this.callParent(arguments);
				}

This should be added to the section schema (like ContactSectionV2). If we are interested in a specific filter in the context of loadGridData we can read current filters using this.getFilters().getItems() and in case a needed filter is found - use additional current day check and restrict grid data loading. 

Thanks! This should work for me, I will try

Show all comments