Home › Forums › Ticket Products › Event Tickets Plus › Modify event’s end date by tribe_get_end_date
- This topic has 18 replies, 3 voices, and was last updated 9 years, 7 months ago by
Cliff.
-
AuthorPosts
-
September 6, 2016 at 12:04 am #1160202
Manuela Hernandez Perez
ParticipantHi,
could you please help me? Unfortunately I’m not very familiar with php strings, but I need to make a slight change to the tribe_get_end_date file. My event dates should be displayed like this:
H:i – H:i \U\h\r (for example: 10:00 – 16:00 Uhr)
Can you give me a clue?
Thank you very much in advance!
Best regards,
ManuelaSeptember 6, 2016 at 2:19 pm #1160642Cliff
MemberHi Manuela. Thanks for your detailed question.
Please visit your wp-admin > Events > Settings > Display tab and refer to our documentation on the date formats at https://theeventscalendar.com/knowledgebase/wp-admin-settings-overview/#dates
Let me know if this answered your question.
September 7, 2016 at 1:03 am #1160813Manuela Hernandez Perez
ParticipantThank you Cliff for your reply. Unfortunately this doesn’t solve the problem because there is no field for what I need available in the settings. I’m quite sure I must edit the tribe_get_end_date file or add sth to functions.php, but I’m not familiar with php. Can you help me out?
Best regards,
ManuelaSeptember 7, 2016 at 6:10 am #1160874Cliff
MemberThe tribe_get_end_date() function has a parameter for $date_format, which by default comes from tribe_format_date(), which defaults to using tribe_get_date_format(), which gets the date format specified in the tribe options.
Long story short, the date format specified in the wp-admin > Events > Settings > Display tab — particularly the first two options in the case you’re asking about — are used unless you need tribe_get_end_date() to have a different $date_format than the rest of your site’s date formats.
I hope this clears things up even if it’s a bit more detailed than you needed. 🙂
I’d suggest entering your preferred date format in those 2 settings and then try things out on your site. Let me know if you need some help with the date formats for those 2 options.
September 8, 2016 at 12:07 am #1161384Manuela Hernandez Perez
ParticipantHi Cliff, thanks for trying, but the settings there are only about date and not about time format. If I insert time there (http://prntscr.com/cfi5ux), I get this result in the frontend: http://prntscr.com/cfi74k
Maybe I did something wrong…(?) However, even if there is a better way to insert the time into these fields, the result would be: 10:00 Uhr – 16:00 Uhr, but I need the word “Uhr” only at the end of a time period, like this: 10:00 – 16:00 Uhr
Thank you in advance for further help!-
This reply was modified 9 years, 7 months ago by
Manuela Hernandez Perez.
September 8, 2016 at 11:02 am #1161637Cliff
MemberManuela, sorry for my confusion here. Thanks so much for the screenshots and additional details.
I spoke with one of our developers and it turns out that we do have Date settings that aren’t meant for DateTime settings. Our Time format comes from WordPress’ options: wp-admin > Settings > General > Time Format option
Please let me know if changing this Time Format option helps in some way.
FYI: I’ve submitted an internal feature request to have a Time Format option specific to just our plugins.
September 9, 2016 at 8:40 am #1162061Manuela Hernandez Perez
ParticipantHi Cliff, it’s me the one who has to apologize. Pressing the wrong button often causes confusion 😉
I changed the wordpress settings, but still this is the result: http://prntscr.com/cg28e8
Can you help me?September 9, 2016 at 12:12 pm #1162225Cliff
MemberNo worries at all.
Please reset your wp-admin > Events > Settings > Display > date formats options back to “date” only and no “time” included.
If it’s still not working as desired for you, please share your System Information. That will give me a lot of extra information to help diagnose the problem.
September 9, 2016 at 1:16 pm #1162251Manuela Hernandez Perez
ParticipantThis reply is private.
September 9, 2016 at 3:42 pm #1162292Cliff
MemberThanks for sending that.
I see your Modern Tribe plugins are not at their latest versions:
Once you verify you’re on the latest versions, please test to see if the issue is still happening for you.
And since only the latest version of The Events Calendar includes extra system information report information, please re-send a fresh copy of it once you’ve updated.
Thanks.
September 11, 2016 at 12:48 pm #1162588Manuela Hernandez Perez
ParticipantThis reply is private.
September 12, 2016 at 8:45 am #1162817Cliff
MemberThank you.
I see you have this information from your System Information Report:
dateWithYearFormat = j. F Y dateWithoutYearFormat = j. F Y monthAndYearFormat = F Y weekDayFormat = D jS WP DATE FORMAT j. F Y WP TIME FORMAT H:iAll that looks fine (i.e. no Time output in a Date-only field, or vice-versa). Also, your settings don’t seem to match the format displayed in http://prntscr.com/cg28e8
Are you still seeing that output? If yes, please clear any caching and switch to a different/new browser to make sure.
I’d also try switching your site language back to English, seeing what you get for the date + time displays, and if that doesn’t work, please provide me a login to your password-protected site. (Please use the Private Reply option.)
Thank you.
September 12, 2016 at 11:11 am #1162912Manuela Hernandez Perez
ParticipantHi Cliff, I had reset the settings already because what was possible is this:
Event Display Settings: http://prntscr.com/ch7uzi
Wordpress General Settings: http://prntscr.com/ch7wr7
But what I need is this example:
14. September 2016, 19:15 – 21:00 Uhr (“Uhr” only behind the end time of a time period)
Can you help please?September 13, 2016 at 3:08 pm #1163635Cliff
MemberLet’s try a CSS solution (just for the Events List widget):
.tribe-events-adv-list-widget .tribe-event-time::after { content: " Uhr"; }You can add custom CSS code via your child theme’s style.css file or via a plugin like Simple Custom CSS or, my favorite, Jetpack. Jetpack supports regular CSS and the LESS and Sass pre-processors.
If you’re not a CSS expert, Jetpack’s Custom Design reference may prove helpful.
Please let me know how it goes for you.
September 13, 2016 at 10:32 pm #1163795Manuela Hernandez Perez
ParticipantThank you Cliff, the CSS solution works great 🙂
Now I have 2 related issues:
In the event details the time period should be shown in the same way: http://prntscr.com/chs87p
In case that the event last over more than one days, the word “Uhr” should be published after the time data of both days: http://prntscr.com/chs79s
Can you help me here as well please?-
This reply was modified 9 years, 7 months ago by
Manuela Hernandez Perez.
-
This reply was modified 9 years, 7 months ago by
-
AuthorPosts
- The topic ‘Modify event’s end date by tribe_get_end_date’ is closed to new replies.
