changing the _EventStartDate format

Home Forums Calendar Products Events Calendar PRO changing the _EventStartDate format

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1628553
    virginiatod
    Participant

    Hi,
    I’m using the events calendar plugin with The7 theme and editing my page with WP Bakery Page Builder.
    The “Page Masonry Grid View” requires a meta key to show the events in date order, and I used _EventStartDate, but the thing is I really NEED to change the format from YYYY-MM-DD hh:mm:ss to DD-MM-YYYY hh:mm, is there any way to do this??

    #1629603
    Cliff
    Member

    Hi. Thanks for your detailed request. Please check out https://theeventscalendar.com/knowledgebase/integrating-events-calendar-slider-revolution-essential-grid/ for some workaround ideas.

    Please let me know how this goes for you.

    #1635320
    virginiatod
    Participant

    I can’t make this work. I need the date to be shown in some other way

    #1635790
    Cliff
    Member

    Sorry to hear that. Please send along what you’ve tried, and I can advise further. Please also share an annotated screenshot, screen capture video, and/or relevant URLs to clarify the context of what you’ve tried that isn’t working.

    #1636149
    virginiatod
    Participant

    I tried creating a shortcode in the functions.php file:

    add_shortcode('string2date', 'string2date_func');
    function string2date_func($atts, $content){
        $atts = shortcode_atts( array(
            'slug' => '_EventStartDate',
            'format' => 'M. j',
        ), $atts);
        $res = '';
        if($atts['slug']){
            $str = get_post_meta(get_the_ID(), $atts['slug'], true);
            $time_stamp = strtotime($str);
            $res = date($atts['format'], $time_stamp);
        }
        return $res;
    }

    and calling it this way:

    [string2date slug="_EventStartDate" format="M. j"]

    But it returns me a wrong date.

    Any suggestions?

    #1636557
    Cliff
    Member

    Gotcha. Please try one of these pre-built solutions instead, as detailed in the Slider Revolution article I previously shared:

    Please let me know how this goes for you.

    #1648752
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘changing the _EventStartDate format’ is closed to new replies.