Skip Navigation

[Resolved] Format date – acf, non types custom field

This thread is resolved. Here is a description of the problem and solution.

Problem:
Format date - acf, non types custo field

Solution:

You can find the proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/split-use-non-types-custom-fields-of-yith-tickets-plugin-for-search-filters-date-filter/#post-1163759

Relevant Documentation:

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by umbertoZ 5 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1163638

Yes! This solved the main problem, they are there and now I can manage those fields.

I still have some issue.

I can display _start_date_picker filed by this shortcode:

[wpv-post-field name='_start_date_picker']

But it seems I cannot change the date format as I can do with a Toolset Date field. How can I manage it?

I also tested the date filter, I can set it up, I also set date_format to Y-m-d (the current data format of _start_date_picker), but the search result is "No items found". I also try setting the Query filter to "like", but it still doesn't get any result.

Any suggestion?

#1163701

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I would like to know in what format _start_date_picker field data saved to database.

As I understand, you want to filter the view using _start_date_picker field - correct? If yes, could you please explain me what filter you want to add?

Please share problem URL and access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1163759

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - I've added the following code to Toolset settings Custom Code section:
=> hidden link

function func_formatted_date_shortcode( $atts ) {
      // default to today if date missing
    $args = shortcode_atts( array (
        'field'      => date( "Ymd", time() ),
        'format'      => "F d,Y",
        'type'      => "date",
      
        ), $atts );
  
     return date($args['format'], strtotime($args['field']) );
  
}
add_shortcode( 'display_formatted_date', 'func_formatted_date_shortcode' );

And within you view - you need to call it as given under to display formated date and time as per your desired format:

      date==[display_formatted_date field="[wpv-post-field name='_start_date_picker']" format='D, M j, Y']
      time==[display_formatted_date field="[wpv-post-field name='_start_time_picker']" format='g:i a']

I've added it here - you can adjust display as required:
hidden link

For filtering issue - I'm opening splitting the ticket here. Please feel free to resolve this ticket.

#1168765

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Would you mind to close this ticket as solution is already shared 🙂

#1168787

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.