Skip to main content

Hello community,

I try to use a display content rule in a view component (table) based on a date. 💅

 

In the documentation /help/display/CIBC/Views+Components#ViewsComponents-DisplayRulesdisplay-rule it states e.g. the comparators:

"DATE_IS" # for 'date'

"DATE_IS_BEFORE" # for 'date'

"DATE_IS_AFTER" # for 'date'

 

The question I'm asking myself is about the formatting of the Value --> in which time format do I need to enter the value?

My guess was "same as in Knowledge Model attribute's definition", but that didn't work for me.

 

I would be very happy if someone could share an example configuration of a Display Content Rule with a date value. Thank you, community! 😊

Hi Caro,

YAML uses ISO 8601 date format, so YYYY-MM-DD

https://www.iso.org/iso-8601-date-and-time-format.html

https://symfony.com/doc/current/components/yaml/yaml_format.html#dates

 

Try both with and without " "

- comparator: DATE_IS

value: 2021-11-27

 

- comparator: DATE_IS

value: "2021-11-27"

 

Best,

Gabriel


Hey both of you,

 

can you please check what´s the problem with this snippet?

It seems it doesn´t work

 

  - id: Datumsvergleich

    displayName: Datum vor heute

    customAttributes:

      - comparator: DATE_IS_BEFORE

        value:

          PQL: ROUND_DAY(toady())

        style:

          textColor: "#E2003d"

          fontSize: 13px

          fontWeight: 400

 

Thank you very much!


Reply