Home › Forums › Calendar Products › Events Calendar PRO › How to change the date format
- This topic has 5 replies, 2 voices, and was last updated 11 years, 1 month ago by
Geoff.
-
AuthorPosts
-
March 12, 2015 at 8:33 pm #948044
Carl
ParticipantHey 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
March 13, 2015 at 8:49 am #948165Geoff
MemberHi 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!
GeoffMarch 16, 2015 at 3:53 am #948510Carl
ParticipantHey 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
March 16, 2015 at 8:07 am #948560Geoff
MemberAwesome, 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
March 19, 2015 at 4:11 am #949305Carl
ParticipantThank you very much Geoff got it to work perfectly in the short code 🙂
March 19, 2015 at 7:41 am #949339Geoff
MemberRad, 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 -
AuthorPosts
- The topic ‘How to change the date format’ is closed to new replies.
