Support

Account

Home Forums General Issues Date/Time Picker Format

Solving

Date/Time Picker Format

  • Hi,
    The page in reference is: http://flycid.com/rfp/

    When I use the date/time picker and set it to the format: February 6, 2017 4:30pm it’s outputting it as 2017-02-22 16:30:00.

    It works fine formatting wise when it’s just the date picker though.

    We are using the divi theme and have added the following code which fixed most of the issues:
    add_action( ‘admin_enqueue_scripts’, ‘slimline_remove_divi_date_scripts’, 100 );

    function slimline_remove_divi_date_scripts() {

    wp_deregister_script( ‘et_pb_admin_date_addon_js’ );

    wp_deregister_script( ‘et_pb_admin_date_js’ );
    }

    Any thoughts on what we can do to fix the date/time picker format so it displays as selected?

    Thanks,
    Kyle-

  • Unfortunately, what you need is someone that’s experienced with divi. I can only guess that there is some filter in the theme that is interfering with the way the value is returned. You need to track down that filter and maybe remove it or if you can’t do that then format the day yourself:

    
    date('F j, Y H:ia', strtotime(get_field('date_field'));
    
  • Hi, we are having issues tracking down the filter. I found the second date/time picker Js file in the theme and removed it since that was originally recommend in an earlier post but it didn’t make any difference. Can you provide more details on your second option and how I can format it myself? Where exactly do I need to put that code?

  • Put the code where you are getting the value from acf, or just incorporate it into the call like I did above

    
    $date = date('F j, Y H:ia', strtotime(get_field('date_field'));
    echo $date;
    
  • Hi, Thank you for the quick response and recommendation. I have tried that although it doesn’t look like anything has changed.

  • Hi kelliott1490,
    The code provided by John Huebner actually works only that it is missing the closing symbol )

    This is what worked for me:
    $date = date(‘F j, Y g:i a’, strtotime(get_field(‘date_field’)));
    echo $date;

  • Don’t know how I missed @kelliott1490 reply about the problem. Thanks @dacgarz for pointing out my typo.

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Date/Time Picker Format’ is closed to new replies.