How to change the date format

Home Forums Calendar Products Events Calendar PRO How to change the date format

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #948044
    Carl
    Participant

    Hey team tribal i would like the date format to display as Sat 11th Jul 2015 and 11th Jul now in the setting i have changed the date format in the settings to l, F j but my date is showing up as 2015-04-05 09:00:00, and how to remove start time ? i wanted to display the events individually so i have created the shortcode and to display the time i used ‘_EventStartDate’.

    Please advice how can i achieve the display date format. Appreciate your help

    #948165
    Geoff
    Member

    Hi there, Carl! Nice to see you again. 🙂

    Good question. The date format all depends on what context the event is being viewed in. For example, a different date format is used in Month View than it is in the Single Event view.

    I was able to get the format you’re looking for by adding this to the “Date without year” field under Events > Settings > Display: D jS  M Y.

    That’s the format you need–now you’ll just want to make sure it’s placed in the appropriate context.

    As far as the time goes, you can remove it using the tribe_events_event_details_formatting() filter like so:

    add_filter( 'tribe_events_event_schedule_details_formatting', 'remove_start_time', 10, 2);
    function remove_start_time( $formatting_details ) {
    $formatting_details['time'] = false;
    return $formatting_details;
    }

    I hope this helps, cheers!
    Geoff

    #948510
    Carl
    Participant

    Hey Thank you Geoff,

    The code you have given worked perfectly with default events page, but how do i get the same date format to show in the custom short code where i have used ‘_EventStartDate’ to display date currently its in “2015-04-30 00:00:00” this format and how can i remove the countdown timer ?? I have placed the code you ahe provided in my child theme functions.php but it does not help.

    Thank you very much

    #948560
    Geoff
    Member

    Awesome, I’m glad that helps on the events page!

    Good question. Honestly, I’m not quite sure how that would apply to your shortcode. It sounds like there might be some custom development there that I wouldn’t exactly be able to help with. You might try pairing the shortcode with the tribe_get_start_date() function. Or, perhaps, check your code to ensure that it is properly referencing _EventStartDate in a way that would respect the calendar’s settings.

    Sorry I don’t have a concrete solution here for you, but I hope this helps point you in the right direction!

    Geoff

    #949305
    Carl
    Participant

    Thank you very much Geoff got it to work perfectly in the short code 🙂

    #949339
    Geoff
    Member

    Rad, awesome work! I’m so glad everything worked out there. 🙂

    I’ll go ahead and close this thread, but fee free to hit us back up if anything else comes up–we’d be happy to help.

    Cheers!
    Geoff

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘How to change the date format’ is closed to new replies.