This sort of question has been answered multiple times - essentially, the technique is to use a multi-value field with a calculated value e.g. based on the dates in the event in your instance, set the colour based on this value and use CSS to hide the multivalue element
The value i want to use is _time or time with %Y%d%m, i checked many posts and found only static values which were used how can we use _time or _time -2.
| eval time=if(relative_time(_time,"@d")=relative_time(now(),"@d"),mvappend(strftime(_time,"%Y-%m-%d"),"today"),if(relative_time(_time,"@d")=relative_time(now(),"-2d@d"),mvappend(strftime(_time,"%Y-%m-%d"),"two days ago"),strftime(_time,"%Y-%m-%d")))
Thanks, but i was looking for something which i can use in color option to color anything today or two days before to something. What i'm looking for is how to use
<format type="color" field="time-check"> <colorPalette type="expression">case (like(value,"%_time%"),"#FF5733")</colorPalette> </format>
<format type="color">
<colorPalette type="expression">if (relative_time(strptime(value,"%Y%m%d"),"@d")=relative_time(now(),"@d") OR relative_time(strptime(value,"%Y%m%d"),"@d")=relative_time(now(),"-2d@d"),"#FF5733",null())</colorPalette>
</format>