Skip Navigation

[Resolved] Format custom post_meta as date

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by thomasS-11 5 months, 1 week ago.

Assigned support staff: Shane.

Author
Posts
#1530725

Hey. I have a date field (Y-m-d) stored as post_meta from another plugin.

I am trying to format it differently in Views.

I tried to just copy the format="d-m-Y" from the wpv-post-date but that didn't work.

Is there any way that i can format this differntly in the View?

#1530927

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Thomas,

Thank you for getting in touch.

"I have a date field (Y-m-d) stored as post_meta from another plugin."

If this field is created by another plugin then the plugin should provide a way to display the date field in the format you want.

The [wpv-post-date] field will only display the default date meta field that is stored on the post i.e the published date.

This shortcode won't display the custom field date that you have.

If the plugin doesn't provide a way to format the date then you will need to do this with custom code.

Thanks,
Shane

#1532225

The shortcode isn't from the plugin. The shortcode is a Views shortcode that's simply fetching post_meta from the current post.
My question and what i was hoping for, was that Views shortcode had a format feature, so it was possible to format the value to a specific date format, even though the field is not a Types field, but simply a post_meta value.
I do know that wpv-post-date is the date from the current post. My hope was that i could use the same attribute "format" to format the data, even if it wasn't a wpv-post-date shortcode.

I will format the value myself in my own shortcode, this way i can move on.