Home › Forums › Calendar Products › Events Calendar PRO › Date format question
- This topic has 10 replies, 2 voices, and was last updated 11 years, 7 months ago by
Geoff.
-
AuthorPosts
-
September 11, 2014 at 3:51 am #737467
Alex Vasquez
ParticipantHi there,
I need to customize a template so that the Display calendar shows a parituclar format. See screenshot: https://www.evernote.com/shard/s2/sh/8995bc4f-39c3-4d41-8a72-695642343df1/0cfbe3a736a1f73b45d195dfd441dea9 – The text in black is how it is now. The text in red is what I want it to more or less be.Thanks so much.
September 11, 2014 at 8:42 am #737983Geoff
MemberHi and welcome back to the forum!
You can customize styles directly in your theme’s CSS file.
Try adding this to your CSS:
.single-tribe_events .tribe-events-schedule h3 { color: #ff2e6c /* or whatever color you want */ }If you need help with more customizations, I’d recommend checking out our Themer’s Guide. There’s a lot of excellent stuff including customized styles.
Does this help? Please let me know.
Cheers!
GeoffSeptember 11, 2014 at 9:29 am #738093Alex Vasquez
ParticipantHey Geoff,
Thanks for a speedy reply. =)
What I meant was the actual Date Format, not the CSS colors. For all Events I want to show Just the Full Month Name, Start Date (Day only), End Date (day only) and the 4 digit year.September 11, 2014 at 10:23 am #738229Geoff
MemberAh, thanks for clarifying! 🙂
The date format can be changed by creating an override of the /public/template-tags/general.php file. Follow the steps for creating custom template files if you’re unfamiliar with creating an override.
Change line 875 of general.php to this:
$schedule .= tribe_get_start_date( $event, false, $date_without_year_format ) . ( $time ? $datetime_separator . tribe_get_start_date( $event, false, $time_format ) : '' );Does that make sense? Will that work for you? Please let me know. Cheers!
Geoff
September 12, 2014 at 8:49 am #740117Alex Vasquez
ParticipantHey Geoff,
I think I still need some help here. THanks for the help so far. I’m familiar with THeme Customization of those items within the Trive-Events folder, inside of a theme. Not sure how to go about modifying the file you note. THe documentation didn’t seem to help on that front.Where would I copy general.php to?
September 12, 2014 at 2:05 pm #740568Geoff
MemberThis this is what your files structure will look like:
/wp-content/[your-theme]/tribe-events/public/template-tags/general.php
Copy the general.php file that is in the plugin files and paste it in the theme override folder. From there, you can edit Line 875 with the code:
$schedule .= tribe_get_start_date( $event, false, $date_without_year_format ) . ( $time ? $datetime_separator . tribe_get_start_date( $event, false, $time_format ) : '' );Let me know if that works. 🙂
Geoff
September 12, 2014 at 2:52 pm #740630Alex Vasquez
ParticipantOkay. I went ahead and did this just fine. I changed the lilne of code you mention and that didn’t seem to make a difference: https://www.dropbox.com/s/pe8kfkguu3zydcx/Screenshot%202014-09-12%2014.51.23.png?dl=0
I removed my previous formatting as well, so this is the unmodified version of the single-events.php template file in my theme folder along with the general.php file.
September 12, 2014 at 5:00 pm #740809Geoff
MemberSorry, I totally led you the wrong way on this one. While general.php is the correct place to change the date format, it is actually not possible to replace it with a theme override. I really apologize for steering you the wrong way there.
What you’ll need to do is write a custom function using the tribe_events_event_schedule_details() filter and add that to your theme’s functions.php file. I’ve double-checked this directly with my team this time and this is the way to go. Here’s a direct link to the documentation. 🙂
You can still edit the general.php file if you’d like, but that customization would be lost the next time the plugin is updated.
Sorry again for the misinformation, but I hope this better answers your question!
Cheers,
GeoffSeptember 15, 2014 at 11:40 am #745014September 15, 2014 at 1:11 pm #745135Alex Vasquez
ParticipantAwesome. Does the trick nicely, Geoff. Thank you.
Lastly, to change the date format of the sidebar widgets and the Archive Events Page, is that more or less change the template files by overriding those, too?
September 15, 2014 at 1:30 pm #745171Geoff
MemberAwesome, glad that worked!
Yes, changing the format in the sidebar widgets would require a similar solution. The widget templates are located in the /views directory, so they can be customized with a theme override, but they also pass the same tribe_events_event_schedule_details(); function.
I’m going to go ahead and close this thread since it seems like we nailed down the original question, but please feel free to start a new thread if any other questions pop up. 🙂
Cheers!
Geoff -
AuthorPosts
- The topic ‘Date format question’ is closed to new replies.
