Forums Forums Search & Filter Pro Displaying datepicker field

Viewing 10 posts - 11 through 20 (of 20 total)
  • Trevor
    #46642

    OK, the get_field('resource_date') part needs to be inside a php function. See here:

    http://php.net/manual/en/datetime.createfromformat.php

    Look at the example#2 towards the bottom.

    Modifying what they have there.

    $resource_date = DateTime::createFromFormat('Ymd', get_field('resource_date'));
    echo '<p class="lol-resource-date">' . $resource_date->format('F j, Y') . '</p>';

    That might even compress down to:

    echo '<p class="lol-resource-date">' . DateTime::createFromFormat('Ymd', get_field('resource_date'))->format('F j, Y') . '</p>';
    
    Anonymous
    #46671
    This reply has been marked as private.
    Trevor
    #46672

    What version of PHP are you using? Check that link and see if I missed something (probably did).

    Anonymous
    #46676

    My local installation is version: 5.4.19.

    My web server installation is version: 5.4.43. I just tested the new code on the staging site and got the same error. It seems my web host is hugely outdated. I will have to contact them and give them crap. But I would hate to think this is the sole reason for this error since it’s not something I can do anything about. Is there something else I can test for?

    I did check that link and couldn’t spot the error. Would it help if you had the entire function that’s used to display the loop?

    Trevor
    #46677

    I am quite tired now, but let me do a test at this end to see what I can find.

    Anonymous
    #46696

    I managed to update the PHP version to 5.5.33 on my web server.

    The function is still not working and now I am not getting any error whatsoever printed to the page nor in the Console. And nothing shows up on the page past the point in the loop where the function exists.

    Trevor
    #46754

    Hi Yvonne

    I need to do this on your server 🙁

    Can you send me ftp logins and admin logins by private reply?

    Which file did you put the code it (so I can find it)?

    And how can I see it in action on the front end?

    Anonymous
    #46786

    I will have to do some backups and push the latest updates to the live server first. I will send yo the info when I’m done.

    Anonymous
    #46887
    This reply has been marked as private.
    Trevor
    #46915

    If you could send logins for me to look, yes please.

Viewing 10 posts - 11 through 20 (of 20 total)