How to highlight an entry from a specific date

You can use [gvlogic] shortcode to compare dates

In the example below, we highlight today's entries by comparing the date stored on the field "Date B" with today's date (using the Gravity Forms Merge Tag {date_dmy}).

Let's start by adding a Custom Content field to our View:

Screenshot showing the View editor with the Custom Content field added

We click the cog icon to configure the contents of the field, then add the following code:

[gvlogic if="{Date B:3:dmy}" is="{date_dmy}"]
	<span style="background-color: green; color: white; padding: 2px 5px;">
		It’s Today

The code uses the [gvlogic] shortcode to check whether the date of the "Date B" field is the same as today's date. If so, the code will output HTML that shows the words "It's Today" with a green background.

Here's how the Custom Content field appears, when configured:

Screenshot showing the Custom Content field with the [gvlogic] shortcode inside

And this screenshot shows how the Custom Content field appears in the View:

Screenshot showing the View

You can read more about the [gvlogic] shortcode and everything possible to achieve here: Using the [gvlogic] shortcode.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us