Home › Forums › Calendar Products › Events Calendar PRO › This week widget day header
- This topic has 11 replies, 3 voices, and was last updated 10 years, 1 month ago by
Brian.
-
AuthorPosts
-
March 15, 2016 at 6:09 pm #1089442
Niall
Participantis there a way to change the date format of the .tribe-this-week-widget-header-date div in the This week widget?
right now it displays: Thu 17th
I’d like to change it to: Thursday March 17th 2016the loop-grid-day is calling:
<div class=”tribe-this-week-widget-header-date”>
<span class=”day”><?php echo esc_html( $day[‘formatted_day’] ); ?></span>
<span class=”date”><?php echo esc_html( $day[‘formatted_date’] ); ?></span>
</div>
I’m not sure how to create and call the format I want,please advise and thanks so much in advance
Andi
March 16, 2016 at 12:56 pm #1089944Niall
ParticipantI had to go into the plugin core to fix this
I changed line 269 of This_week.php to:
$display_date_format = apply_filters( ‘tribe_events_this_week_date_format’, ‘l, F jS, Y’ );and then called it from the template in my theme.
that fixed the problem, but now I can’t update my plugin
any suggestions?
March 16, 2016 at 1:46 pm #1089978Brian
MemberHi Again,
To make changes to the plugin it is best to do it using hooks and the template system following our themer’s guide:
https://theeventscalendar.com/knowledgebase/themers-guide/
In this case you would want to edit this file:
plugins/events-calendar-pro/src/views/pro/widgets/this-week/loop-grid-day.php
Here in your theme:
yourtheme/tribe-events/pro/widgets/this-week/loop-grid-day.php
There you could take the date as formatted and change up how it displays.
That would be safer for updates.
Let me know if you have any follow up questions.
Thanks
March 16, 2016 at 4:15 pm #1090044Nico
ParticipantHello, i have the same problem. it now displays ma 14th and i want to change it into maandag 14 maart (dutch) i changed the directory to yourtheme/tribe-events/pro/widgets/this-week/loop-grid-day.php but i can’t find the right setting to change into the date format i want
can you help me
kind regards Nico
March 16, 2016 at 4:29 pm #1090052Niall
Participantsadly I can’t do that, the $display_date_format is created in the
public static function this_week_query( $this_week_query_vars )
I then reference it in the loop-grid.php.
<?php echo esc_html( tribe_events_get_this_week_title( $this_week_template_vars[‘start_date’] ) ); ?>
thanks for your feedback though!!!
-
This reply was modified 10 years, 1 month ago by
Niall.
March 17, 2016 at 12:44 am #1090147Nico
ParticipantBut i still have also a problem my day and date is displayed as: mo 14th and i want it to be displayed as: maandag 14 maart therefore i need to change these lined:
<span class=”day”><?php echo esc_html( $day[‘formatted_day’] ); ?></span>
<span class=”date”><?php echo esc_html( $day[‘formatted_date’] ); ?></span>do you know what i need to place instead of formatted_day and formatted_date to get the results displayed as: maandag 14 maart instead of ma 14th
hope one of you can help me
March 17, 2016 at 6:35 am #1090236Niall
ParticipantHi Nico,
I deleted the first line<span class=”day”><?php echo esc_html( $day[‘formatted_day’] ); ?></span>
and then went into This_Week.php (its in the plugin folder inside the pro version, Pro/Src/Tribe
change this:
$display_date_format = apply_filters( ‘tribe_events_this_week_date_format’, ‘jS’ );to this:
$display_date_format = apply_filters( ‘tribe_events_this_week_date_format’, ‘l, F jS, Y’ );that puts it into the correct format (at least that the format I want, you can change it, just google “date format wordpress”)
the only prob is that I’ve changed my core files so I’ll have to track this when I do updates (like the one I did last night)
I wish I knew how to put this change into my theme, maybe there is a way to put the function into my theme’s functions file…
If anyone knows how to do this please chime in
March 17, 2016 at 2:33 pm #1090642Brian
MemberHi Nico,
You can try what Andrea did, but it is not recommended as the plugin with overwrite those changes.
It is not possible to edit a method from your theme as it is the templates.
Beyond that I do not have information on how to make a customization such as this.
Thanks
March 18, 2016 at 6:19 am #1090916Niall
Participantcan I place the method in my theme’s functions.php file and have it override the one in the plugin core?
March 18, 2016 at 8:01 am #1090960Brian
MemberHi Andrea,
That is not possible. PHP does not work that way.
March 18, 2016 at 9:53 am #1091060Niall
Participantokie dokie, thanks anyway
March 18, 2016 at 1:28 pm #1091175Brian
MemberYou’re Welcome.
Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic on the forum and we can help you out.
Thanks
-
This reply was modified 10 years, 1 month ago by
-
AuthorPosts
- The topic ‘This week widget day header’ is closed to new replies.
