Toggle a class based on two variables?

I have a list of records and one of the data fields is a date field. I have a form with two form fields - start date and end date.

What I would like to do is change the background of records that fall between those two dates.

I can set two toggles, one for greater than start date and one for less than end date but that of course hilights all the records.

How can I do a ‘between’ in a class toggle? I assume there would be some custom coding to do this?

I haven’t tried, but could you use something like > date1 && < date2 ?

{{(date1 >= date2) ? 'classA' : 'classB'}}

1 Like

You ca use the class toggle like:

dmx-class:myclass="dynamic_date >= input_start_date.value && dynamic_date <= input_end_date.value "
3 Likes

Hmmm, I thought I tried that. I must have had some syntax wrong. Works great, thanks!

1 Like