ACF Date Field Value Custom Format in Bricks

In the Bricks forum, a user asks:

Hi there, I am setting up an events calendar using bricks.

In some circumstances I would like to display the date of the event as just ‘21 Dec’ and in other places with the year too and maybe written day i.e. ‘Friday 21 Dec 2022’ .

I have created a custom field with acf for the date and it works great in my repeater on the front end, but how can I change the output of the date on a case by case basis?

Simplified I’d like to do something like {acf_date:d j}

This Pro tutorial shows how we can define a custom function and use that with the Dynamic data feature of Bricks to output any Advanced Custom Fields' Date-type of field in the specified format.

Step 1

Edit the Date Picker-type of field in your field group.

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 525 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
ACF Checkbox Sub Field as Unordered List in Bricks

ACF Checkbox Sub Field as Unordered List in Bricks

Updated on 22 Sep 2023 This Pro tutorial shows how the checked options of a Checkbox-type of Sub Field inside a ACF Repeater field can…
Categories:
Pro
Filtering posts by a group field’s true / false field sub field value with ACF or Meta Box in Bricks

Filtering posts by a group field’s true / false field sub field value with ACF or Meta Box in Bricks

This Pro tutorial covers how posts of a Bricks query loop can be filtered to show only the ones whose true / false or checkbox…
Categories:
Tags:
Pro
ACF Post Object Query Loop inside a Posts Query Loop in Bricks

ACF Post Object Query Loop inside a Posts Query Loop in Bricks

How to loop through a CPT and within each post, output a list of related posts.
Categories:
ACF Checkbox Items with Custom SVG Bullets in Bricks

ACF Checkbox Items with Custom SVG Bullets in Bricks

We walk through outputting list items with SVG icons based on the choice of a ACF Checkbox field.
Categories:
Tags:
How to create a dynamic infinite logo slider with ACF and Bricks

How to create a dynamic infinite logo slider with ACF and Bricks

This tutorial provides the builder settings, PHP & CSS codes that can be pasted in order to create an infinite logo slider in pure CSS…