Get the difference between ACF fields

Hi,

  1. In CCS, I’ve been using the ACF relationship to get fields from another post. This is bidirectional relationship.
  2. I am getting the difference between two custom fields (one from another post)
  3. I am assigning CSS classes according to the result.
  4. If the ACF field of the current post is greater, it creates an outgoing div class, otherwise it creates an incoming class.

The CCS code I am using is as such:

<div class="single_acf_cases [set diff][calc][field year]-[get postyear] [/calc][/set][pass vars][-if check={DIFF} value=0 compare='>']incoming[-else]outgoing[/-if][/pass]">

So that I can style different post titles according to the difference between the YEAR fields.
These are legal cases, and they are referring to each other. Unfortunately the ACF relationship plugin does not differentiate between incoming and outgoing relationships and therefore I’ve resorted to this method.

Could you please help me how to convert this code to L&L?

By the way, the following is the full code, but I’ve figured out the other parts.

[if field="damages-cases"]
    <div class="linked-cases">
        <div class="cases-title"> 
        <a href="[taxonomy substantive term=damages field=url]">Linked Cases Regarding the [taxonomy substantive term=damages] Standard </a>
    </div>
    <div class="case-full-cases">
        [related damages-cases]
        <div class="single_acf_cases [set diff][calc][field year]-[get postyear] [/calc][/set][pass vars][-if check={DIFF} value=0 compare='>']incoming[-else]outgoing[/-if][/pass]">
            [field title-link]
        </div>
        [/related]
    </div>
</div>
[/if]