SOLVED: Date format incompatibility between jetEngine and Bricks?

Bricks Version: 1.5.7
Browser: Brave 146.134
OS: macOS
URL: [(Metamorphosis – Motherwort)]

Problem: Bricks displays the wrong date value for jetEngine custom date fields if saved in ‘default’ date format, but can meta query it properly. And using a date field saved as a timestamp, it displays and sorts correctly, but won’t filter the query. Screenshots at the bottom.

Detailed steps to reproduce:

Bricks and JetEngine, absolutely no other plugins.
Make a custom CPT with jetEngine having 2 date fields.

Save one date field as the ‘default’ type, and on the other set the slider to ‘timestamp’ in the settings as seen in the screenshot.

Screen Shot 2022-12-04 at 6.42.19 PM

I named them ‘date-default, and ‘date-timestamp’

Make a few dummy posts in your CPT, some that contain future dates, some past, ensure that the pairs of dates are the same within each post.

In Bricks, place 2 headings in a container, 1 for each date field and use a dynamic data request to populate their text.

Prepend each dynamic value with their respective DB key to keep track of them.

Use the container to set a query loop for the CPT you made above.

You should see a list of date pairs.

The date field saved with the ’timestamp’ option will display the date as entered.

The date field saved with the ‘default’ option will display the CURRENT DATE (and if you use a datetime field it updates when the browser is refreshed to the current time)

The one saved as a date field with the ‘timestamp’ option (that shows the correct date) if used as a meta query filtered against the current date will NOT filter the posts. it lets all of them through.

HOWEVER, using the same query with the ‘default’ date (that shows the current date) will query correctly! (both fields seem to sort correctly though.)

So it seems I can either choose a format that displays correctly but I cant filter with, or can filter but displays the wrong date.

Any insight would be greatly appreciated! I would prefer to not ask my client to enter all of their dates in duplicate…

Screen shots:
Confusingly, sorting seems to work with either date field.

Meta query with the date formatted as default (date-default) works other than the display of the date itself.
Screen Shot 2022-12-04 at 5.54.29 PM

Meta query with the timestamp formatted date (date-timestamp) displays correctly but won’t filter.
Screen Shot 2022-12-04 at 5.55.11 PM

2 Likes

Did you find any solution to this issue?

I’m facing a similar situation where I’m trying to show events happening from today and after, but still can’t find a way to hide past date events. Thanks in advance!

Hi @ArkeyWave and @threestone

I am very sorry that we missed this thread.
I can replicate the issue in the JetEngine date field which is unable to show the correct date if not set as timestamp.
Dev team is working on it.

Regarding the Query, if you will use meta query to compare with a timestamp field, cannot use {current_date} as this will return ‘2023-11-01’ as example. The meta query should be using NUMERIC type for a timestamp field as well.

We may add a new filter like {current_date:timestamp} so it can return the current timestamp when comparing.

Regards,
Jenn

1 Like

Hi,
We’ve fixed this issue in Bricks 1.9.3 by adding the mentioned :timestamp filter, now available as a one-click update in your WordPress Dashboard.

Changelog: Changelog – Bricks

Please let us know if you are still experiencing issues.

Best regards,
timmse